8.hcna_hntd--Data Forwarding Process

Source: Internet
Author: User

The TCP/IP protocol family and the underlying protocol cooperate to ensure that the data can achieve end-to-end transmission. The data transfer process is a very complex process, such as a series of encapsulation and encapsulation in the process of forwarding. For network engineers, only in-depth understanding of the data in a variety of different devices in the forwarding process, the network can be properly analyzed and detected.

Learning Goals:
1. Mastering the process of data encapsulation and encapsulation
2. Handling basic failures during data forwarding

Data can be transmitted within the same network or between different networks, the data forwarding process is also divided into local forwarding and remote forwarding, but the two principles of data forwarding are basically the same, all follow the TCP/IP protocol cluster.
In this example, host a needs access to server A's Web service and assumes that a TCP connection has been established between the two. This example is followed to illustrate the transfer of data between different networks.


Host a treats the sent application data first with related operations such as encryption and compression, after which the transport layer is encapsulated. A Web application transmits data based on the transport layer's TCP protocol. When host a uses TCP for packet encapsulation, it must populate the source port and destination port fields, the initial sequence number and confirm serial number fields, identify bits, window fields, and checksum fields. In this example, the source port number of the data segment is host a randomly selected port 1027th, the destination port number is TCP well-known port 80 for Server A.


When host a completes the Transport Layer encapsulation, the network layer data is usually encapsulated, and the source and destination address of the IP packet need to be clarified when using IP for encapsulation. If the size of the IP packet is greater than the maximum Transmission Unit (MTU) of the network, the message may be fragmented during transmission.
The time to Live (TTL) field is used to reduce the impact of network loops. The ARG3 series routers generate packets with a default TTL value of 255. When the router forwards a packet, the value is reduced by 1, and if the router discovers that the value is reduced to 0, the packet is discarded. This way, even if there is a loop in the network, the packet is not always forwarded on the network.
The Protocol field identifies the protocol used by the transport layer. In this case, the transport layer uses the TCP protocol, so the padding value for this field is 0x06.


Each host will maintain its own routing table entries on its own. Host a needs to check to see if the destination is reachable before sending the data, which is done by locating the route. In this example, host A has a route to "any network" (outlined in the IP Addressing section), and the data destined for the other network is forwarded to the next hop via an interface with an IP address of 10.1.1.1, which is the gateway 10.1.1.254.


Next, because the packet is to be encapsulated as a data frame, host a needs to get the next hop MAC address, which is the MAC address of the gateway. The host first queries the ARP cache table. In this example, the table entry for the Gateway MAC address exists in the ARP cache table for host A.
If you do not find the MAC Address table entry for the gateway, host a obtains the MAC address of the gateway by sending an ARP request.


When host a encapsulates a data frame at the link layer, it adheres to the IEEE 802.3 or Ethernet_II Standard, and the Type field in the Ethernet_II frame header is populated with 0x0800 to indicate that the network layer is using the IP protocol. The source MAC address is the MAC address of host A, and the destination MAC address is the MAC address of the gateway router e0/0 interface.


Host a operates in half-duplex, so the CSMA/CD is used to detect if the link is idle. If the link is idle, host a attaches a preamble (preamble) and a first frame delimiter (SFD) to the frame header and then transmits it. The purpose of the preamble is to synchronize the receiving device and prepare to receive the data frame. The preamble is a code that includes 7 bytes of binary "1", "0" alternating, or 1010 ... 10 Total 56 bits. The first delimiter is a 1-byte 101,010,112-bit sequence, which is the function of enabling the receiving end to position the first position of the frame.


In this example, host a sends a data frame to a shared Ethernet, and all network devices in this network receive the frame. After the device receives the frame, the FCS check is performed first. If the FCS check fails, the frame is immediately discarded. For frames that pass the FCS check, the device checks the destination MAC address in the frame. If the destination MAC address in the frame differs from its own MAC address, the device discards the frame and, if the same, continues processing. During processing, the frame end is stripped (i.e. unpacked) and the remaining data packets are sent to the corresponding protocol module in the network layer based on the value of the Type field in the frame header.


When RTA receives this data message, the network layer will process the message. RTA first checks the integrity of the IP datagram header based on the checksum field in the IP header information, and then looks at the routing table based on the destination IP address to determine whether the packet can be forwarded to the destination. RTA must also process the value of the TTL. In addition, the message size cannot exceed the MTU value. If the message size exceeds the MTU value, the message will be fragmented.
When the network layer processing is complete, the message is sent to the data link layer to be re-encapsulated to become a new data frame, and the head of the frame encapsulates the new source MAC address and destination MAC address. If the current network device does not know the next-hop MAC address, it will use ARP to obtain it.


In this example, Server A is in a shared Ethernet network, and both servers receive data frames sent by RTB. The destination MAC address of the frame does not match the interface MAC address of Server B, so it is discarded by Server B.
Server A successfully receives the frame and passes the FCS checksum. Server A uses the Type field in the frame to identify the protocol that processes the data at the network layer. In this example, server A will give the unpacked data to the IP protocol of the network layer for processing.


Server A uses the IP protocol to process the message, first verifying the integrity of the header with a checksum field, and then checking to see if the destination IP address in the IP header matches its current IP address.
If a message shard occurs during data transfer between source and destination, the message is re-assembled at the destination. The Identity field identifies the Shard message belonging to the same data source, and the offset represents the relative position of the Shard in the original grouping. The Flag field is currently only two bits meaningful, the lowest bit of the flag field is 1, which means that there is also a shard, 0 means that this is the last piece of data, the middle one is 1 means it cannot be fragmented, and 0 means that shards are allowed. All Shard packets must be received by the destination before being re-assembled.
The Protocol field represents the data of which protocol the upper-layer data is carried by this packet. It is important to note that the next header is not always the transport layer header. For example, the ICMP message is also encapsulated with the IP protocol, and the Protocol field value is 0x01.


When the IP packet header is processed and stripped, the data segment is sent to the transport layer for processing. In this example, the Transport layer protocol uses TCP, and the sending and receiving sides have already established a connection through a three-time handshake. After the transport layer receives the data segment, the TCP protocol views and processes the header information for the data segment, where the destination port number is 80, which is used to represent the HTTP protocol for the application-layer protocol that processes the data. After processing the header information, TCP will split the header of the data segment and then send the remaining application data to the HTTP protocol for processing.

Summarize:
1. What information does the host need to know before making the two-and three-tier packages?
2. What happens to non-destination hosts when a data frame is sent to a non-destination host?
3. How can the transport layer accurately deliver data to specific applications?
4. When two hosts simultaneously access the server's HTTP service, how does the server differentiate which session the data belongs to?
For:
1. The host must know the destination IP address before encapsulating the packet. Before you encapsulate a data frame, you must know the route to the destination network and the MAC address of the next hop.
2. If the host receives a data frame that is not destined to itself, the frame is discarded after verifying the destination MAC address in the frame header.
3. The transport layer will check the destination port number in the TCP or UDP header to identify the specific application.
4. The server can only identify the HTTP traffic of two hosts through the source IP address, and the source port contained in the TCP header can also be used to differentiate between different sessions initiated by the same host through different browsers. For example, two HTTP traffic from the source IP to 10.1.1.1 is used with a destination port number of 80, but the source port number is 1028 and 1035.

8.hcna_hntd--Data Forwarding Process

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.