Routers--Information transfer

Source: Internet
Author: User
Router Introduction

A router (Router, also known as a pathfinder) is a computer network device that transmits packets to a destination via a network (selecting the transmission path of the data), a process called routing. Routers are devices that connect more than two individual networks, and routing works on the third layer of the OSI model-the network layer, such as the Internet Protocol (PROTOCOL,IP) layer.
How routers work

HostA (Host a) work content:

1. Encapsulate the upper-level message as an IP packet

2. Determine if the subnet mask and destination IP address are in the same network segment

3. If no, you need to "route a" forwarding

4. Send an ARP request to get the MAC address of "route a" and encapsulate the address as the destination MAC address

Route a work content:

1. Remove the Data link layer package, anza whether the table has a destination IP network segment

2. Depending on the destination IP segment being queried, it is sent to the destination network address, and if it is far, the target MAC address of the package is changed to the next "Route B" MAC address

3. Send to Next "Route B"

Route B Work content:

1. Remove the Data Link layer package and match the destination IP to the routing table for route B

2. If the network segment is detected as a direct connection, the MAC address of the target HOSTB is obtained via ARP broadcast

3. Send to HostB information supplement router: forward the destination address in the routing table and add the next MAC address in front of the packet the TTL domain of the IP header begins to subtract, and the calibration is recalculated The routing table, which is updated periodically according to the rules of the routing Information protocol used, is dynamic and effective. has layered addressing capabilities. In the event of an error, an ICMP packet is sent to the source IP address to decompose the larger packet into an appropriate size, sent out by the same or different path, and when it arrives at the destination address, the packet is wrapped sequentially into the original message form layered addressing: IP Address layering: compare it to a phone number: region--prefix--user number IP: Network address--subnet--host address TTL: time to Live, specify the maximum number of network segments allowed before the IP packet is discarded by the router, TTL: Time to live, how much time ping packets can exist on the network. The TTL is set by the sending host to prevent packets from continually looping on the IP internetwork forever. When forwarding IP packets, the router is required to reduce the TTL by at least 1.

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.