전체 페이지뷰

2013년 1월 20일 일요일

Tcp key function note

Port numbers assignments are managed by IANA to ensure universal compatibility around the global Internet. The numbers are divided into three ranges: well-known port numbers used for the most common applications, registered port
numbers for other applications, and private/dynamic port numbers that can be used without IANA registration.

Well-known and registered port numbers are needed for server processes since a client must know the server’s port number to initiate contact. In contrast, client processes can use any port number. Each time a client process
initiates a UDP or TCP communication it is assigned a temporary, or ephemeral, port number to use for that conversation. These port numbers are assigned in a pseudo-random way, since the exact number used is not important, as long as each process has a different number.

In most TCP/IP client/server communications, the client uses a random ephemeral port number and sends a request to the appropriate reserved port number at the server’s IP address. The server sends its reply back to whatever
port number it finds in the Source Port field of the request.

The overall identifier of a TCP/IP application process on a device is the combination of its IP address and port number, which is called a socket.

Each device may have multiple TCP connections active at any given time. Each connection is uniquely identified using the combination of the client socket and server socket, which in turn contains four elements: the client IP address
and port, and the server IP address and port.

The User Datagram Protocol (UDP) was developed for use by appli- cation protocols that do not require reliability, acknowledgment or flow control features at the transport layer. It is designed to be simple and fact, providing only
transport layer addressing in the form of UDP ports and an optional checksum capability, and little else.

The User Datagram Protocol (UDP) is probably the simplest in all of TCP/IP. All it does is take application layer data passed to it, package it in a simplified message format, and send it to IP for transmission.

UDP packages application layer data into a very simple message format that includes only four header fields. One of these is an optional checksum field; when used, the checksum is computed over both the real header and a
“pseudo header” of fields from the UDP and IP headers, in a manner very similar to how the TCP checksum is calculated.

TCP provides reliable communication only by detecting failed trans- missions and re-sending them. It cannot guarantee any particular transmission, because it relies on IP, which is unreliable. All it can do is keep trying if an initial
delivery attempt fails.

To summarize TCP’s key characteristics, we can say that it is connection-oriented, bidirectional, multiply-connected, reliable, acknowledged, stream-oriented and flow-managed.

TCP is designed to have applications send data to it as a stream of bytes, rather than requiring fixed-size messages to be used. This provide maximum flexibility for a wide variety of uses, because applications don’t need to worry about
data packaging, and can send files or messages of any size. TCP takes care of packaging these bytes into messages called segments.

Since TCP works with individual bytes of data rather than discrete messages, it must use an identification scheme that works at the byte level to implement its data transmission and tracking system. This is accomplished by
assigning each byte TCP processes a sequence number.

Since applications send data to TCP as a stream of bytes and not prepackaged messages, each application must use its own scheme to determine where one application data element ends and the next begins.

댓글 없음:

댓글 쓰기