Network layer

 

router's data forwarding table



 Select the following data forwarding export based on the previous IP range

 

Routing Algorithms and Forwarding

The routing algorithm is to determine the path, forwarding is responsible for the import and export of data, and data conversion

 

There are two key functions in the router

1. Run routing algorithms and routing protocols

2. Forward data from the input link to the output link

 

Switching fabrics

 


 

The overall structure of the network layer



 

IP datagram format:


Detailed transfer process

 


Explanation: Each ip datagram can actually only be loaded with 1480byte, 20byte with the configuration of the protocol itself

           fragflag represents whether it is the last datagram

          The offset represents the offset in the datagram relative to the initial time, and the data itself will also be divided into small modules


 application:

        Subnet (subnet)

   

        Network address: The host address is all 1

        Broadcast address: The host address is all 0

        ip address & mask = network address

       

        IP addresses are divided into the following categories:

        1---(2^7-1)=1---127 Class A (do not take 127.0.0.1)

         2^7---(2^7+2^6)=128---192 Class B (do not take 192.0.0.1)

         192---(192+2^5)=192---224 Class C (do not take 224.0.0.1)

        224---255 Class D

        Example: If China Telecom assigns you a network address of 202.117.12.32/29

               Or represented as 202.117.12.32 with a mask of 255.255.255.247

               Then it means that the ip address you can assign is: 202.117.12.32-----202.117.12.40

               202.117.12.32 indicates its network address and cannot be assigned, and 202.117.12.40 is its broadcast address and cannot be assigned

              Therefore, the address that can be assigned is: 202.117.12.33----39, and any one can be taken from the middle as the gateway of the network

         Example: In the previous question, if I want to divide two subnets (it's so small, it's not too annoying). Then the network address becomes

              202.117.12.32/30 and 202.117.12.36/30, but its network address on the external network is still 202.117.12.32/29

             From the external network, the ip of the destination address is sent to the internal network. First, the destination ip: 202.117.12.34 is compared. First, it is calculated with the mask of each subnet in turn, and the subnet of the destination of the ip address is calculated. network address, and then send the data to the subnet.

 

network address translation


Explanation: This structure is generally used now. This structure can have 2^16 hosts (theoretically). When passing through 138.76.29.7, the intranet will change its source address to 138.76.29.7+ port (distinguish the intranet host ), the destination address remains unchanged. The reverse is also the same, send it to the host of the corresponding port, and change the destination address to the ip address of the intranet and the port of the corresponding program. Children who want to invade should pay attention, this is very important for invading the intranet. (Port forwarding, of course you have to take down the external network host)

 

IPV6 packet format

 



 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326917892&siteId=291194637