赶尽杀绝什么意思| 脑卒中是什么意思| 眼皮黑是什么原因| 内分泌紊乱是什么意思| 总胆固醇是什么意思| 美尼尔综合征是什么原因引起的| 54岁属什么的| 京ag6是什么意思| 梦见自己死了预示什么| 盍是什么意思| 吃蒸苹果有什么好处| 玄牝是什么意思| 造瘘手术是什么意思| 散光什么意思| 灯火通明是什么生肖| 手指头发红是什么原因| jvc是什么牌子| 单核细胞高是什么原因| 左什么右什么| 吃什么可以补胶原蛋白| 不撞南墙不回头是什么意思| 行气是什么意思| 铁蛋白高吃什么食物好| 凝血功能差是什么原因| 白发缺少什么维生素| 吃什么不会胖| 子宫肌瘤是什么原因造成的| 长期喝什么水可以美白| 狗舔人是什么意思| 检查梅毒挂什么科| 化妆水是干什么用的| 艾滋通过什么途径传播| 湿疹是什么原因引起的起的| 内向的人适合什么职业| 控评是什么意思| 我想长胖点有什么办法| 风湿吃什么药| 什么是g点| 什么人心什么| 做梦梦到踩到屎是什么意思| LOP是什么胎位| 潜规则是什么| 吃玉米有什么好处| 查尿常规挂什么科| 诠释的意思是什么| 桃花什么季节开| 黄色分泌物是什么原因| 敏字五行属什么| 验大便能查出什么| 油菜花什么时候开| 什么是玫瑰痤疮| 北京是我国的什么中心| 六月一号什么星座| 钢笔刻字刻什么好| 肚子胀气老放屁是什么原因| 什么钻进风箱里两头受气| 今天拉警报什么意思| 疏肝理气吃什么药| 几天不大便是什么原因| 飞蛾为什么扑火| 老人头发由白变黑是什么原因| 得了肠胃炎吃什么最好| tt是什么| 淋巴结肿大看什么科室最好| 什么叫野鸡大学| 口腔溃疡什么症状| 档案自由可投什么意思| 心脏早搏有什么危险| 脸颊为什么会凹陷| 办健康证需要检查什么| 猪八戒是什么佛| 医保卡是什么| 蛋白粉和胶原蛋白粉有什么区别| 湿气重怎么调理吃什么| 雪纳瑞什么颜色最贵| 支气管炎有什么症状| 什么是熊猫血| 左侧卵巢多囊样改变什么意思| 婚动是什么意思| 中国的国树是什么树| 萘是什么| 什么东东是什么意思| 九加虎念什么| 手脚冰凉什么原因| 旺夫脸是什么脸型| 什么相争| 不等闲是什么意思| 拉肚子不能吃什么食物| 乳头有点痒是什么原因| 唐僧姓什么| 椰子什么时候成熟| 生蚝什么时候最肥| 黄梅时节是什么季节| 打了封闭针后要注意什么事项| 胸闷气短吃什么药| 孕妇做无创是检查什么| dna什么意思| 什么时候看到的月亮最大| 早搏有什么危害| 检查胃镜需要提前做什么准备| 两个山念什么| 阳虚火旺吃什么中成药| alpha是什么| 卵巢疼是什么原因| 成双成对是什么数字| 为什么会得阑尾炎| 梦见死了人是什么意思| 黄瓜有什么好处| 蔓越莓对女性妇科有什么好处| 白带异常是什么原因| 羊水多了对宝宝有什么影响| 双侧苍白球钙化是什么意思| 化疗和靶向有什么区别| 波菜不能和什么一起吃| 溥仪什么时候去世的| 类风湿什么症状| 月经来头疼是什么原因引起的| 什么是法定节假日| 藿香正气水不能和什么药一起吃| 骨皮质扭曲是什么意思啊| 做梦梦见蜘蛛是什么意思| 血小板低吃什么好补| 促甲状腺激素低是什么原因| 腰肌劳损是什么原因引起的| 阴唇大什么原因| 遥遥相望是什么意思| ab是什么意思| 激光脱毛对身体有什么危害| 潮湿是什么意思| 猪肝有什么功效| 舌根放血有什么好处| 韭菜籽配什么壮阳最猛| 卵泡回声什么意思| 治疗舌苔白厚用什么药| 什么叫孝顺| 乱伦是什么| 蛇鼠一窝是什么生肖| 后背酸疼是什么原因| 冰点脱毛的原理是什么| 极端是什么意思| 道貌岸然是什么生肖| 泡奶粉用什么水最好| 大便检查能查出什么病| 小三阳吃什么食物好得快| 深圳有什么好玩的地方| 躯体形式障碍是什么病| 隋朝之前是什么朝代| 桂圆不能和什么一起吃| 靖国神社是什么地方| 做试管前需要检查什么项目| 8五行属什么| 深藏不露是什么意思| 颈椎生理曲度变直是什么意思| 卒中患者什么意思| 教师节送老师什么礼物最好| 今年气温为什么这么高| 双眸是什么意思| 不举什么意思| 幽门螺杆菌阳性吃什么药| 扁桃体看什么科室| 罗贯中是什么朝代的| 五行缺金是什么命| 鸟在家里做窝预示什么| 太后是皇上的什么人| 高血压挂什么科室| 一九七八年属什么生肖| 3月21日什么星座| 什么是结膜炎| 口臭是什么原因引起的| 肥胖纹长什么样| 什么是品质| 刺身是什么意思| 游山玩水是什么意思| 一什么绳子| 什么是蚕豆病| 什么贵人能治孤辰寡宿| 小狗感冒吃什么药| 皮笑肉不笑是什么生肖| 下九流指的是什么| 肌肉痉挛用什么药能治好| 玉米蛇吃什么| 佛跳墙是什么菜系| 血压高有什么表现| 天津市市长什么级别| 吃什么精力旺盛有精神| 胃湿热吃什么药| 人放屁多是什么原因| 子宫前位后位有什么区别| 我国最早的中医学专著是什么| 天台是什么意思| 什么粉底液最好用| 仲夏是什么意思| 三月底是什么星座| 什么是高筋面粉| 什么东西最养胃| 199是什么意思| 青春期什么时候结束| 经期可以吃什么水果| 阑尾炎可以吃什么水果| 刺猬和豪猪有什么区别| 平台期是什么意思| 尿急是什么原因| 间羟胺又叫什么| 血清和血浆有什么区别| 宝典是什么意思| 经常眩晕是什么原因引起的| 月经不调吃什么药调理最好| 年抛是什么意思| 胃癌是什么原因引起的| 什么益生菌能减肥| 普惠幼儿园是什么意思| 借记卡是什么卡| 不经意间是什么意思| 小猫咪吃什么| 发财树是什么树| 红曲红是什么东西| 宫内膜回声欠均匀是什么意思| 牛肉不能和什么食物一起吃| 7月份可以种什么菜| 木薯粉是什么做的| 芥蒂什么意思| 病理切片是什么意思| 检查前列腺做什么检查| 2009是什么年| c是什么车| 三八妇女节送什么好| 教师节送什么礼品| 皮肤敏感是什么意思| 养乌龟有什么好处| 能屈能伸是什么生肖| 什么叫增值税| 上火为什么会牙疼| 惊厥是什么症状| 长一智的上一句是什么| 颈椎病是什么症状| 阳痿吃什么| 胡汉三回来了什么意思| 什么叫柞蚕丝| 人为什么会死| 老是叹气是什么原因| 先河是什么意思| 肤浅是什么意思| 吃葡萄干对身体有什么好处| 梦到鱼是什么意思| 游走性疼痛挂什么科| 吃恩替卡韦有什么副作用| 单元剧是什么意思| 第二次世界大战是什么时候| 剖腹产坐月子吃什么| 宁的五行属性是什么| 水瓶座什么性格| mafia是什么意思| 什么鱼吃玉米| 避孕药什么时候吃有效| 手脚麻木吃什么药| 耳垂后面疼是什么原因| rs是什么意思| 什么姿势最舒服| cop是什么| 社保缴费基数什么意思| 舒化奶适合什么人喝| 孩子发烧按摩什么部位退烧| 2b什么意思| 3个火念什么| 百度

让道德与法为知识产权“保驾护航”

百度 当然,这场Show的意义并不仅仅就此而已,它打破了传统的秀场演绎,连带VFILES与ADIDAS等品牌将其以主题的形式呈现,成为了结合品牌好友、音乐人表演等环节为一体的盛宴性发布会。

A network socket is a software structure within a network node of a computer network that serves as an endpoint for sending and receiving data across the network. The structure and properties of a socket are defined by an application programming interface (API) for the networking architecture. Sockets are created only during the lifetime of a process of an application running in the node.

Because of the standardization of the TCP/IP protocols in the development of the Internet, the term network socket is most commonly used in the context of the Internet protocol suite, and is therefore often also referred to as Internet socket. In this context, a socket is externally identified to other hosts by its socket address, which is the triad of transport protocol, IP address, and port number.

The term socket is also used for the software endpoint of node-internal inter-process communication (IPC), which often uses the same API as a network socket.

The use of the term socket in software is analogous to the function of an electrical female connector, a device in hardware for communication between nodes interconnected with an electrical cable. Similarly, the term port is used for external physical endpoints at a node or device.

The application programming interface (API) for the network protocol stack creates a handle for each socket created by an application, commonly referred to as a socket descriptor. In Unix-like operating systems, this descriptor is a type of file descriptor. It is stored by the application process for use with every read and write operation on the communication channel.

At the time of creation with the API, a network socket is bound to the combination of a type of network protocol to be used for transmissions, a network address of the host, and a port number. Ports are numbered resources that represent another type of software structure of the node. They are used as service types, and, once created by a process, serve as an externally (from the network) addressable location component, so that other hosts may establish connections.

Network sockets may be dedicated for persistent connections for communication between two nodes, or they may participate in connectionless and multicast communications.

In practice, due to the proliferation of the TCP/IP protocols in use on the Internet, the term network socket usually refers to use with the Internet Protocol (IP). It is therefore often also called Internet socket.

Socket addresses

edit

An application can communicate with a remote process by exchanging data with TCP/IP by knowing the combination of protocol type, IP address, and port number. This combination is often known as a socket address. It is the network-facing access handle to the network socket. The remote process establishes a network socket in its own instance of the protocol stack and uses the networking API to connect to the application, presenting its own socket address for use by the application.

Implementation

edit

A protocol stack, usually provided by the operating system (rather than as a separate library, for instance), is a set of services that allows processes to communicate over a network using the protocols that the stack implements. The operating system forwards the payload of incoming IP packets to the corresponding application by extracting the socket address information from the IP and transport protocol headers and stripping the headers from the application data.

The application programming interface (API) that programs use to communicate with the protocol stack, using network sockets, is called a socket API. Development of application programs that utilize this API is called socket programming or network programming. Internet socket APIs are usually based on the Berkeley sockets standard. In the Berkeley sockets standard, sockets are a form of file descriptor, due to the Unix philosophy that "everything is a file", and the analogies between sockets and files. Both have functions to read, write, open, and close. In practice, the differences strain the analogy, and different interfaces (send and receive) are used on a socket. In inter-process communication, each end generally has its own socket.

In the standard Internet protocols TCP and UDP, a socket address is the combination of an IP address and a port number, much like one end of a telephone connection is the combination of a phone number and a particular extension. Sockets need not have a source address, for example, for only sending data, but if a program binds a socket to a source address, the socket can be used to receive data sent to that address. Based on this address, Internet sockets deliver incoming data packets to the appropriate application process.

Socket often refers specifically to an internet socket or TCP socket. An internet socket is minimally characterized by the following:

  • local socket address, consisting of the local IP address and (for TCP and UDP, but not IP) a port number
  • protocol: A transport protocol, e.g., TCP, UDP, raw IP. This means that (local or remote) endpoints with TCP port 53 and UDP port 53 are distinct sockets, while IP does not have ports.
  • A socket that has been connected to another socket, e.g., during the establishment of a TCP connection, also has a remote socket address.

Definition

edit

The distinctions between a socket (internal representation), socket descriptor (abstract identifier), and socket address (public address) are subtle, and these are not always distinguished in everyday usage. Further, specific definitions of a socket differ between authors. In IETF Request for Comments, Internet Standards, in many textbooks, as well as in this article, the term socket refers to an entity that is uniquely identified by the socket number. In other textbooks,[1] the term socket refers to a local socket address, i.e. a "combination of an IP address and a port number". In the original definition of socket given in RFC 147,[2] as it was related to the ARPA network in 1971, "the socket is specified as a 32-bit number with even sockets identifying receiving sockets and odd sockets identifying sending sockets." Today, however, socket communications are bidirectional.

Within the operating system and the application that created a socket, a socket is referred to by a unique integer value called a socket descriptor.

Tools

edit

On Unix-like operating systems and Microsoft Windows, the command-line tools netstat or ss[3] are used to list established sockets and related information.

Example

edit

This example, modeled according to the Berkeley socket interface, sends the string "Hello, world!" via TCP to port 80 of the host with address 203.0.113.0. It illustrates the creation of a socket (getSocket), connecting it to the remote host, sending the string, and finally closing the socket:

Socket mysocket = getSocket(type = "TCP")
connect(mysocket, address = "203.0.113.0", port = "80")
send(mysocket, "Hello, world!")
close(mysocket)

Types

edit

Several types of Internet socket are available:

Datagram sockets
Connectionless sockets, which use User Datagram Protocol (UDP).[4] Each packet sent or received on a datagram socket is individually addressed and routed. Order and reliability are not guaranteed with datagram sockets, so multiple packets sent from one machine or process to another may arrive in any order or might not arrive at all. Special configuration may be required to send broadcasts on a datagram socket.[5] In order to receive broadcast packets, a datagram socket should not be bound to a specific address, though in some implementations, broadcast packets may also be received when a datagram socket is bound to a specific address.[6]
Stream sockets
Connection-oriented sockets, which use Transmission Control Protocol (TCP), Stream Control Transmission Protocol (SCTP) or Datagram Congestion Control Protocol (DCCP). A stream socket provides a sequenced and unique flow of error-free data without record boundaries, with well-defined mechanisms for creating and destroying connections and reporting errors. A stream socket transmits data reliably, in order, and with out-of-band capabilities. On the Internet, stream sockets are typically implemented using TCP so that applications can run across any networks using TCP/IP protocol.
Raw sockets
Allow direct sending and receiving of IP packets without any protocol-specific transport layer formatting. With other types of sockets, the payload is automatically encapsulated according to the chosen transport layer protocol (e.g. TCP, UDP), and the socket user is unaware of the existence of protocol headers that are broadcast with the payload. When reading from a raw socket, the headers are usually included. When transmitting packets from a raw socket, the automatic addition of a header is optional.
Most socket application programming interfaces (APIs), for example, those based on Berkeley sockets, support raw sockets. Windows XP was released in 2001 with raw socket support implemented in the Winsock interface, but three years later, Microsoft limited Winsock's raw socket support because of security concerns.[7]
Raw sockets are used in security-related applications like Nmap. One use case for raw sockets is the implementation of new transport-layer protocols in user space.[8] Raw sockets are typically available in network equipment, and used for routing protocols such as the Internet Group Management Protocol (IGMP) and Open Shortest Path First (OSPF), and in the Internet Control Message Protocol (ICMP) used, among other things, by the ping utility.[9]

Other socket types are implemented over other transport protocols, such as Systems Network Architecture[10] and Unix domain sockets for internal inter-process communication.

Socket states in the client-server model

edit

Computer processes that provide application services are referred to as servers, and create sockets on startup that are in the listening state. These sockets are waiting for initiatives from client programs.

A TCP server may serve several clients concurrently by creating a unique dedicated socket for each client connection in a new child process or processing thread for each client. These are in the established state when a socket-to-socket virtual connection or virtual circuit (VC), also known as a TCP session, is established with the remote socket, providing a duplex byte stream.

A server may create several concurrently established TCP sockets with the same local port number and local IP address, each mapped to its own server-child process, serving its own client process. They are treated as different sockets by the operating system since the remote socket address (the client IP address or port number) is different; i.e. since they have different socket pair tuples.

UDP sockets do not have an established state, because the protocol is connectionless. A UDP server process handles incoming datagrams from all remote clients sequentially through the same socket. UDP sockets are not identified by the remote address, but only by the local address, although each message has an associated remote address that can be retrieved from each datagram with the networking application programming interface (API).

Socket pairs

edit

Local and remote sockets communicating over TCP are called socket pairs. Each socket pair is described by a unique 4-tuple consisting of source and destination IP addresses and port numbers, i.e. of local and remote socket addresses.[11][12] As discussed above, in the TCP case, a socket pair is associated on each end of the connection with a unique 4-tuple.

History

edit

The term socket dates to the publication of RFC 147 in 1971, when it was used in the ARPANET. Most modern implementations of sockets are based on Berkeley sockets (1983), and other stacks such as Winsock (1991). The Berkeley sockets API in the Berkeley Software Distribution (BSD), originated with the 4.2BSD Unix operating system as an API. Only in 1989, however, could UC Berkeley release versions of its operating system and networking library free from the licensing constraints of AT&T's copyright-protected Unix.

In c. 1987, AT&T introduced the STREAMS-based Transport Layer Interface (TLI) in UNIX System V Release 3 (SVR3).[13] and continued into Release 4 (SVR4).[14]

Other early implementations were written for TOPS-20,[15] MVS,[15] VM,[15] IBM-DOS (PCIP).[15][16]

Sockets in network equipment

edit

The socket is primarily a concept used in the transport layer of the Internet protocol suite or session layer of the OSI model. Networking equipment such as routers, which operate at the internet layer, and switches, which operate at the link layer, do not require implementations of the transport layer. However, stateful network firewalls, network address translators, and proxy servers keep track of active socket pairs. In multilayer switches and quality of service (QoS) support in routers, packet flows may be identified by extracting information about the socket pairs.

Raw sockets are typically available in network equipment and are used for routing protocols such as IGRP and OSPF, and for Internet Control Message Protocol (ICMP).

See also

edit

References

edit
  1. ^ Cisco Networking Academy Program, CCNA 1 and 2 Companion Guide Revised Third Edition, P.480, ISBN 1-58713-150-1
  2. ^ RFC 147
  3. ^ Jack Wallen (2025-08-06). "An Introduction to the ss Command".
  4. ^ V. S. Bagad, I. A. Dhotre (2008), Computer Networks (5th revised edition, 2010 ed.), Technical Publications Pune, p. 52
  5. ^ SO_BROADCAST, Microsoft, retrieved 2025-08-06
  6. ^ Class DatagramSocket, Oracle, retrieved 2025-08-06
  7. ^ Ian Griffiths for IanG on Tap. 12 August 2004. Raw Sockets Gone in XP SP2
  8. ^ "raw(7): IPv4 raw sockets - Linux man page". die.net.
  9. ^ "Raw IP Networking FAQ". faqs.org.
  10. ^ "www-306.ibm.com - AnyNet Guide to Sockets over SNA". Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  11. ^ books.google.com - UNIX Network Programming: The sockets networking API
  12. ^ books.google.com - Designing BSD Rootkits: An Introduction to Kernel Hacking
  13. ^ (Goodheart 1994, p. 11)
  14. ^ (Goodheart 1994, p. 17)
  15. ^ a b c d "historyofcomputercommunications.info - Book: 9.8 TCP/IP and XNS 1981 - 1983". Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  16. ^ The Desktop Computer as a Network Participant.pdf 1985

Further reading

edit
  • Jones, Anthony; Ohlund, Jim (2002). Network Programming for Microsoft Windows. Microsoft Press. ISBN 0-7356-1579-9.
edit
肺部积液吃什么药 长期戴耳机有什么危害 面包属于什么类食品 月经提前是什么原因引起的 衔接班是什么意思
冰淇淋是什么做的 龟苓膏是什么做的 月德合是什么意思 rf是什么 短裤搭配什么鞋子
鳜鱼是什么鱼 什么时间吃水果最好 1992年属什么生肖年 脸色发青是什么原因引起的 蜜蜡脱毛有什么危害吗
内秀是什么性格的人 拔牙什么时候拔最好 摩拳擦掌是什么生肖 献血对身体有什么好处 紫微星是什么意思
rf是什么意思hcv9jop1ns7r.cn 蒲公英叶和根的功效有什么不同bjcbxg.com 阿修罗是什么意思hcv9jop4ns3r.cn 1978年属马五行属什么jingluanji.com 鱼油有什么副作用bjhyzcsm.com
梦见大老鼠是什么意思hcv9jop6ns8r.cn 边缘视力是什么意思hcv9jop8ns2r.cn 唐人是什么意思hcv9jop2ns8r.cn 血压忽高忽低是什么原因hcv9jop5ns2r.cn 忌出火是什么意思hcv8jop3ns8r.cn
眼睛做激光手术有什么后遗症hcv9jop0ns1r.cn 口腔溃疡吃什么水果好得快hcv8jop2ns5r.cn 无用功是什么意思hcv9jop6ns0r.cn 什么是羊水栓塞hanqikai.com 口腔义齿是什么hcv8jop3ns0r.cn
吃什么去黄气美白hcv9jop3ns3r.cn 以什么之名clwhiglsz.com 吃酸的有什么好处hcv8jop4ns3r.cn 拍大腿内侧有什么好处hcv7jop6ns9r.cn 原字五行属什么hcv8jop9ns3r.cn
百度