The protocols involved in network and data transmission in the network

Source: Internet
Author: User

Network : Several computer hosts or network printers, such as interface devices, through a network cable or wireless network technology to connect it, so that data can be transmitted through the Internet media (cable and other hardware such as network cards) to transmit a way.

Network Classification :

1. Ethernet (Ethernet): LAN (local area Network,lan) is using Ethernet

Ethernet transmission Speed unit is used in Mbps, it should be noted that the B is a bit instead of our usual byte, so our home in the fixed bandwidth when the actual download speed needs to be divided by 8 to get the general speed.

Our common network cable is for the transmission of Ethernet data, through the host's network card to connect to another host's network card or hub (hub) "Hub" * Note 1 "

Transport protocol for Ethernet: CSMA/CD

Ethernet transmission is the key is Ethernet card (often referred to as network cards), each card has a "fixed" network card known as the MAC address (6bytes size, is the hardware address identification), so can be used to determine the location.

Inter-machine data transfer in Ethernet is the use of the CSMA/CD protocol to send MAC data frames, MAC data frame is composed of the following:

* The destination address and the source address are the MAC addresses

Note 1: The hub is a network-shared media device, and all hosts in the local area network connect to him, sending the data to the hub when communication between hosts is required, and the negative person forwards it until the target host receives and receives the data. A non-shared media device called switch is also similar, but the principle of forwarding data is different, the hub is to pass data to all machines, but only the target machine is received, and the switch is to save the target MAC address, it can be sent directly to the target host. "Please search by yourself" for specific differences.

Summary: Through the above we can see that the hardware part of the Ethernet network cable, network cards, Hub/switch and so on, and data transmission using the card number for the standard MAC data frame with CSMA/CD standard to transfer.

Note: The above said LAN internal data transmission through Hub/switch can be completed, but if we want to transfer data over the WAN, we need to use a router (that is, the default gateway), the first data transfer to the router, The router is then transferred to the target host's network segment via multiple hops (the default gateway), which is then distributed to the target host through its "public ip/mac table".

2. Internet: The WAN (Wide area Network,wan) is using the Internet

    the communication protocol used by the Internet is the TCP/IP protocol, which is a four-tier model :

      

One of the items that need to be described here is the bottom two layer of the TCP/IP four layer model above, and we find that the IP packets are actually ready before the destination is determined by the LAN or WAN, and at the last layer, each host has a routing table that records the IP of the local area network. Through the IP packet with the target IP address to find out whether the target host is the local area network, the assumption is found in the same LAN, by the above has said that the actual LAN transmission using MAC packets, so here is how to deal with it? The IP packet is actually encapsulated in the MAC data frame according to the CSMA/CD standard and the frame header is added. If you find that you are not on the same LAN, send the IP packets directly to the router for subsequent forwarding.

In the actual process, such as open the browser input URL and click Enter, this time the URL information and related information will be wrapped into data upload to the application layer, at this time using the HTTP protocol to encapsulate data and join the application layer header after the incoming Transport layer, because HTTP is a reliable connection, Therefore, the TCP protocol is used to encapsulate and join the TCP header after the incoming network layer, encapsulating it into the IP packet and adding the IP header to the network interface layer, to determine the target host address after the corresponding processing after the conversion to bitstream for transmission. Finally, the following relationship is formed (note the order of each header):

      

Note: The ARP protocol and the ICMP protocol

ARP protocol: (address Resolution Protocol) network addresses Resolution Protocol, we know that the IP is also configured on the network card, the above mentioned network card has a fixed network card number (MAC address), in fact, the IP address is configured by the software on the specified network card, By sending an ARP packet to the LAN, you can return the MAC address of the network card where the specific IP configuration resides. Note: Get the NIC mac address: #ifconfig, get the native Ip/mac address data: #arp-N "

ICMP protocol: (Internet Control message Protocol) Internet Information Control Protocol, which is an error detection and reporting mechanism, used to ensure the connection status of the network, the common Ping and traceroute command is the use of this Protocol, It also needs to be placed in the IP packet for transmission.

    

    Now look at the header of the common TCP protocol

      

* We often say that TCP is a stable state connection, its three-time handshake (host settings Syn=1 after the package, the target host back to the packet set ACK is 1, the host will Syn and ACK is 1 of the package is sent to the target host again. A TCP connection was established after the three-time contract "handshake"

    as with the above using the CSMA/CD standard to transfer MAC data frames, here is the use of TCP/IP protocol to transmit IP packets, the IP header is as follows :

      

* The protocol number pointed to the TCP,UDP and ICMP and so on;

If the IP packet is too large to be re-composed of a few small IP packets and put into the Mac, it needs the "identification code", "Special Flag", "segmented offset" in the table above three indicators to complete the subsequent IP packet reorganization

Time to live: Range 0~255, each time a router TTL is reduced by one, and this packet is automatically discarded after 0

Header Check code: Checking the header for errors

    Mac frame Header The previous section has been introduced

    

Summary: By now we understand that we send a specific data to the target host, respectively, through the package of what the protocol and which hardware finally based on what to find the target host.

The protocols involved in network and data transmission in the network

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.