Transport Layer: tcp udp sctp

Source: Internet
Author: User
Tags ping and traceroute

Overview

Although the Protocol family is called "TCP/IP", there are many other members in addition to the two main protocols, TCP and IP. Figure 2-1 shows an overview of these protocols.

Figure 2-1 shows both IPv4 and IPv6. From the right to the left, the five network applications on the rightmost are using IPV6, And the next six network applications are using IPv4.

The network application named tcpdump on the leftmost side can use the BSD grouping filter (BPF) or the data link layer Provider Interface (dlpi) to directly communicate with the data link layer. The dotted line below the nine applications on its right is marked as API, which is usually socket or xTi. Interfaces that access BPF or dlpi do not use sockets or xTi.

Figure 2-1 also indicates that the traceroute program uses two sockets: IP socket for IP Access, and ICMP socket for ICMP access.

Next we will explain each protocol box in 1-2-1.

IPv4 uses 32 as the address, and IPv4 provides the Group delivery service for TCP, UDP, sctp, ICMP, and IGMP.

IPv6 uses a 128-bit larger address. IPv6 provides Group delivery services for TCP, UDP, sctp, and ICMPv6.

TCP transmission control protocol. TCP is a connection-oriented protocol that provides a reliable full-duplex byte stream for user processes. TCP socket is a stream socket. TCP cares about details such as validation, timeout, and retransmission. Note that TCP can use either IPv4 or IPv6.

UDP user data packet protocol. UDP is a connectionless protocol. A udp socket is a datagram socket. UDP datagram cannot reach their destination. Like TCP, UDP can use either IPv4 or IPv6.

Sctp traffic control transmission protocol. Sctp is a connection-oriented protocol that provides reliable full-duplex Association. We use the term "association" to reference connections in sctp. Because sctp is multi-host, each of the two ends of the association involvesA group of IP addresses and a port number. Sctp provides message services, that is, maintains record boundaries from the application layer. Like TCP and UDP, sctp can use both IPv4 and IPv6, and can also use them in the same association.

ICMP Internet Control Message Protocol. ICMP processes errors and control messages circulating between routers and hosts. These messages are usually generated and processed by the TCP/IP network supporting the software itself (rather than the user process), but the Ping and traceroute programs shown in the figure also use ICMP. Sometimes we call this Protocol ICMPv4 to distinguish it from ICMPv6.

IGMP internet group management protocol. IGMP is used for multiple times. It is optional in IPv4.

ARP Address Resolution Protocol. ARP maps an IPv4 address into a hardware address (such as an ethernet address ). ARP is usually used for broadcast addresses such as Ethernet, ring-based network, and FDDI. It is not required on point-to-point networks.

RARP Reverse Address Resolution Protocol. RARP maps a hardware address into an IPv4 address. It is sometimes used for guidance without inventory check.

Bpf bsd grouping filter. This interface provides access to the data link layer.

Dlpi data link provider interface. This interface also provides access to the data link layer, which is usually provided with the svr4 kernel.

 

User data packet protocol (UDP)

UDP is a simple transport layer protocol. The application process writes a message to a UDP socket. The message is then encapsulated into a UDP datagram. The UDP datagram is then encapsulated into an IP datagram and then sent to the destination. UDP does not guarantee that the UDP datagram will arrive at its final destination. It does not guarantee that the order of each datagram remains unchanged after the network is exceeded, nor does it guarantee that each datagram will arrive only once.

Each UDP datagram has a length. If a datagram reaches its destination correctly, the length of the datagram will be transmitted along with the data to the receiving end application process. We have mentioned that TCP is a byte stream protocol with no record boundaries, which is different from UDP.

We also say that UDP provides a connectionless service because there is no long-term relationship between the UDP client and the server. For example, a UDP client can create a socket and send a datagram to a given server, and then immediately send another datagram to another server using the same socket. Similarly, a UDP server can use the same UDP socket to receive data packets from several different clients. Each client has one data packet.

 

Transmission Control Protocol (TCP)

The services provided by TCP to application processes are different from those provided by UDP. First, TCP provides a connection between the customer and the server. A tcp client establishes a connection with a given server, exchanges data with that server across the connection, and then terminates the connection.

Second, TCP also provides reliability. When TCP sends data to the other end, it requires the Peer to return a confirmation. If no confirmation is received, TCP automatically retransmits the data and waits for a longer time. TCP gave up after several retransmission failures, so the total time spent on trying to send data is generally 4 ~ 10 minutes.

TCP associates a serial number with each of them to sort the sent data. For example, assume that an application writes 2048 bytes to a TCP socket, causing TCP to send two shards: the serial number of the data contained in the First Shard is 1 ~ 1024. The serial number of the data contained in the second shard: 1025 ~ 2048. (each segment is the data unit transmitted by TCP to the IP address .) If these segments arrive in an unordered manner, TCP at the receiving end first sorts the segments based on their serial numbers, and then transmits the result data to the receiving application. If the receiving end receives repeated data from the peer end, TCP can determine that the data is duplicated and discard the repeated data.

Again, TCP provides traffic control. TCP always tells the peer how many bytes of data can be received from the peer at any time. This is called a notification window. At any time, this window indicates the amount of space currently available in the receiving buffer, so as to ensure that the data sent by the sending end does not cause the receiving buffer to overflow. The window size changes dynamically at the moment: when the data from the sending end is received, the window size decreases. However, when the receiving end application reads data from the buffer, the window size increases. It is possible to reduce the size of the notification window to 0: when the receiving buffer of a socket corresponding to TCP is full, it must wait for the application to read data from the buffer before receiving data from the peer end.

 

Stream Control transmission protocol (sctp)

Sctp provides services similar to UDP and TCP. Sctp provides associations between customers and servers, and provides applications with reliability, sorting, traffic control, and full-duplex data transmission like TCP. In sctp, the word "join" is used to replace "connection" to avoid such connotation. A connection interface involves communication between two IP addresses. An association refers to one communication between two systems. It may involve more than two addresses because sctp supports multiple hosts.

A "join" association is composed of multiple one-way "streams. Each stream is relatively independent. data can be sent independently without being influenced by other streams, and user data can be submitted in an orderly manner.

Unlike TCP, sctp is message-oriented. It provides ordered delivery services for each record. Like UDP, the length of each record written by the sending end is transmitted along with the data to the receiving end application.

Sctp can provide multiple streams between connected endpoints. Each stream reliably delivers messages in order.. The loss of a message in a stream does not block the delivery of messages in the same and associated other streams. This is the opposite of TCP. For TCP, the loss of bytes at any position in a single byte stream will block the delivery of all the data after the connection, until the loss is fixed.

Sctp provides the multi-host feature, allowing a single sctp endpoint to support multiple IP addresses. This feature enhances the robustness of network faults. One endpoint may have multiple redundant network connections, and each network may have their own connection to the Internet infrastructure. When this endpoint is associated with another endpoint, if one of its networks or a path spanning the Internet fails, sctp can avoid faults by switching to another address that already has this association.

 

Transport Layer: tcp udp sctp

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.