Wan Wan
TCP/IP is generally considered to be a four-layer protocol system, including
- The link layer includes the ARP,RARP protocol, which includes the NIC driver in the operating system and the corresponding network interface card, which processes the details of the data transmission between the cables, which is within the same link network and communicates through the MAC address between the different interfaces. The ARP protocol is based on the IP address, request the corresponding MAC address, the RARP protocol is based on the MAC address, request the IP address (can be used to do the boot to get the IP address, the actual has not done so now), the second layer of the typical device is the switch, the switch has a MAC address and the corresponding port rules table, Whenever a packet is received, if it is an ARP broadcast packet, then the packet is taken from all interfaces of the switch (this is not considered VLAN first), and if it is not a broadcast packet, the switch matches the destination MAC address to which port it should forward the data to, and then throws it out of the corresponding port. The bridge is a low-end version of the switch, there are similar features, can be connected to the network at the link layer, Linux Bridge is a virtual network bridge. Switch and bridge isolation conflict domains.
- Network layer including IP,ICMP,IGMP protocol, IP address and routing equipment, are the concept of network layer, link layer of communication, only one or more switches connected to the network, in fact, the same network, the MAC address of the machine inside can not conflict, an ARP packet, all the machine can receive, Therefore, even if we do not consider the cost of the problem, we will not be all the world's machines are directly received, one such network (WAN), we need to put their own network, link layer and the outside of the network isolation, through the routing equipment and their communication, so many benefits, back again analysis. Routing device is the network layer of the device, it stores the IP address and corresponding interface of the corresponding relationship, through the routing protocol, according to the destination IP address select the next hop IP address (also be a routing device or virtual routing device or destination address), through the ARP protocol to get to the next hop MAC address, modify the packet, The destination MAC address is set to this address, which is thrown to the link layer and sent out by the link layer. Router Isolated broadcast domain
- The transport layer, including the TCP protocol, is the UDP protocol. The transmission of the network layer is mainly a ip+ port number, the data is sent to another ip+ port number, this port number is used to distinguish between different applications, tell the operating system, the package is sent to the program, which is thrown into which cache, which program is responsible for the read out. UDP is unreliable transmission, regardless of the transmission of the process of packet loss, usually in the host communication using UDP, inter-host communication, if using UDP, need to do their own transmission reliability test. TCP design idea is as reliable as possible transmission, to ensure that the data has been determined to be transmitted to, as far as possible to avoid congestion, so TCP design is not to occupy more bandwidth and design, multiple links can improve transmission speed, TCP design in the network faster and faster situation, the storm leaks out a lot of defects, and then talk about later.
- Application layer, the level of various application work
TCP/IP Volume One reading note (1) TCP/IP layer four protocol