The network layer refers to data transmission between networks. when data is uploaded and transmitted in different subnets, the MAC address cannot be used for Broadcast Transmission. routes and layer-3 IP addresses are required to ensure communication.
Network Layer tasks: 1. Network Addressing 2. Route Selection 3. Exchange Transmission
1. Network Addressing
The IP address is the network layer address, the IP address is the routing service, and the route is selected based on the IP address. Why not use a MAC address, even if the IP address of each device is globally unique?
Because Mac is not layered, it is only suitable for broadcast mode and is not suitable for routing. The addresses that can be routed must have unicast mode and hierarchical structure.
IP address specification: IPv4 IPv6
IPv4: 32-bit W. x. y. Z Network number + host number a, B, c, d, e address
Unreasonable, resulting in a waste of network numbers
If the network number is the same, it indicates that the same subnet does not require routing and broadcast addressing is required.
Unicast, broadcast, and Multicast
Broadcast address: if z = 255 is sent to this address, it is broadcast to the whole subnet.
Multicast: send to a group (Class D is used for multicast addresses)
Host number of IP address 0,127,255
Loopback address 127.0.0.1
Valid address: Reserved address (address never used on the Internet, which can be used on a LAN)
1. Pure routing, which is equivalent to directly attaching to the public network must be a legal IP Address
2. the routing + NAT or proxy can be an Invalid Address.
Translation of NAT addresses (tampering with IP packets to change invalid addresses into valid addresses)
Proxy servers (for you to download and access the internet) are not transparent to users and some applications are not used yet.