Network layer of computer networks

Source: Internet
Author: User

1, Network layer Responsibilities:

Responsible for forwarding packets between different networks (based on IP address), not responsible for retransmission, not responsible for the order.

Note: During the two host communication process, each packet selects a routing path individually.


2, the router can see the IP address, so work in 3 layers. The following application tiers (hubs, switches, routers) are not poisoned, but are affected by viruses and so on.


3, Network layer Related:

IP Address: 10. 0.0.0

Subnet Mask: 255.0.0.0 (according to the subnet mask not 255 parts, you can determine the network segment is 0.0.0, the gateway is the router's IP is 10.0.0.1)

Gateway: 10.0.0.1


4, the computer communication process:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5A/D7/wKiom1T9rCHRaDqTAAOkgkXpW9Q488.jpg "title=" Computer communication process. png "alt=" wkiom1t9rchradqtaaokgkxpw9q488.jpg "/>

Here, starting from the sender (PC4), the receiver (PC3) operates on the reverse side:

1) Application layer: Prepare the content to be sent and transmitted;

2) Transport Layer: The application layer content is segmented and numbered;

3) Network layer: Add destination IP, source IP, use your own subnet mask to determine their own and destination address in that network segment, if the same network segment, using the ARP protocol to obtain the other's MAC address; otherwise, use the ARP protocol to get the MAC address of the route (Gateway). It is then passed to the link layer for transmission.


5. TCP/IP protocol stack:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5A/D7/wKiom1T9q5WzDToaAAGPllHN_6c742.jpg "title=" tcp_ IP protocol stack. png "alt=" wkiom1t9q5wzdtoaaagpllhn_6c742.jpg "/>

Where the underlined part is the network layer protocol. As you can see, the network layer is divided into 3 levels: ARP protocol, IP protocol, ICMP/IGMP protocol.


6, Arp/rarp (reverse ARP):

Arp:ip address, MAC address (see if the IP address is cached in the ARP cache, and if so, return the corresponding MAC address directly; otherwise, the local area network broadcast destination MAC address is ff-ff-ff-ff-ff-ff and the IP address is the destination IP request Group, The destination machine that matches the IP address responds to a packet containing its own MAC address, obtaining the MAC address of the destination host, and storing the mapping relationship in the ARP premium cache for next use)

Note: ARP resolves the problem of the relationship between the IP address of the host, the router, and the MAC address mapping on the same LAN. For non-LAN communication, first find the Gateway Mac, and then the rest of the work is done by the next network.


Rarp:mac Address-IP address (the host reads the MAC address from the network card, and then sends a RARP request broadcast packet over the net, requesting the RARP server to reply to the IP address of the PC; The RARP server receives the RARP request packet, assigns it an IP address, The RARP response is sent to the host, and after the host receives the RARP response, it communicates with the resulting IP address. )。


Get ARP Advanced cache: ARP-A

Edit ARP Advanced cache: ARP-S IP address MAC address

Clear ARP Advanced cache: Local connection--fix


ARP spoofing: Using the ARP broadcast mode, with the fake MAC address, the packet interception, forwarding.


Tools: Network Marshal, peer Terminator (return wrong Gateway Mac), ARP firewall


7. ICMP protocol: Internet Control Message Protocol

IGMP protocol: Internet Multicast Management Protocol (for multicast, multicast, such as the same distribution of TV information, can not delay the change of progress and so on. ), can be used for video, etc., saving a lot of bandwidth resources.


8. Ping command: Send ICMP packets to troubleshoot network failures.

Time: Time delay;

TTL: Prevents packets from looping over the network, up to 64 routes, each via a route, TTL minus 1 (Different operating systems, TTL defaults not the same, Linux is 64,windows for 128,unix 255).

Example:

Ping/?

Ping 192.168.1.2-t (non-stop hair)


9, PATHPING: Tracking packet routing path, calculation of packet loss

TRACERT: Trace Packet routing path.


10. IP Packet Structure:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5A/D2/wKioL1T9ubmQW15nAAL1dehcmcY450.jpg "title=" ip.png "alt=" Wkiol1t9ubmqw15naal1dehcmcy450.jpg "/>

Where the Protocol field identifies the protocol used for the contents of the packet, such as: Icmp:1,igmp:2,tcp:6,udp:17. Other parts of the meaning and rules can be Baidu.


Note: The network layer has a single packet maximum of 65,535 bytes, and the link-Layer packet range is 46~1500 bytes. Therefore, the packet needs to be fragmented, and if not fragmented, the content is up to 1480 bytes.


11. IP protocol:

RIP: A distributed routing protocol based on distance vectors.

3 points: Exchange information with neighboring routers only; The information exchanged is all the information known to the router at the moment, i.e. its own routing table; Exchange routing information at regular intervals.


Ospf


12, static routing, dynamic routing:

Static routing: The Administrator sets up the routing table (need to set up all the networks without the smart-linked next hop to whom, only for small-scale networks);

View route table: show IP route

Edit route table (operating router): Config t

IP Route 192.158.1.0 255.255.0.0 172.16.2.0

Dynamic routing: IP-based protocol, self-identifying update (Router Zhou Qi Broadcast routing table, not 30 seconds to update the routing information, the maximum hop number is 16).


13, the network unimpeded conditions:

Packets have to go back. If there is a problem, check the routing table, Gateway.


Note: This series of articles is for watching Han Ligang teacher's computer network Basic course made notes.

This article is from the "Inner Peace, Fire Rebirth" blog, please be sure to keep this source http://itisforyou.blog.51cto.com/9778869/1618839

Network layer of computer networks

Related Article

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.