Need IP address and MAC address for several reasons

Source: Internet
Author: User

Each Ethernet device has a unique MAC address at the factory, why do I need to assign an IP address to each host? or if each host is assigned a unique IP address, why should a unique MAC address be embedded in the production of a network device (such as a NIC, hub, router, etc)?

There are several main reasons for this:

(1) The allocation of IP addresses is based on the topology of the network, not on who created the network settings. It is not feasible to build an efficient routing scheme on the basis of the device manufacturer rather than the topology location where the network is located.

(2) When there is an additional layer of address addressing, the device is easier to move and repair. For example, if an Ethernet card is broken, it can be replaced without having to obtain a new IP address. If an IP host moves from one network to another, it can give it a new IP address without having to change a new network card.

(3) convenient data transmission. The communication between the computers in the LAN and the WAN is ultimately the result of sending the packet from the initial node of some form of link to the other node from one node to the destination node. The movement of packets between these nodes is done by the ARP protocol that maps IP addresses to MAC addresses.

An example of a combination of IP address and MAC address for sending packets:

Suppose a host on the network (named PAC) is sent to Washington by a host in Beijing with a name of A,ip address of Ip_a,mac address (mac_a) (the name is B,ip address is ip_b,mac). The two hosts can not be directly connected, so the packet must pass through a number of intermediate nodes (such as routers, servers, etc.), we assume that in the process of transmission through the C1, C2, C3 (its MAC address is m1,m2,m3) three nodes.

A before the PAC is issued, an ARP request is sent to locate the MAC address M1 of the First intermediate node C1 that it must go through to ip_b, and then encapsulate (encapsulation) These addresses in its packet: Ip_a, Ip_b,mac_a, and M1.

When the PAC is uploaded to C1, and then by ARP based on its destination IP address ip_b, find the Second intermediate node C2 's MAC address M2 to go through, and then transfer the packet with M2 to C2.

So on, until finally find the address of the B host with the IP address of ip_b Mac_b, eventually transmitted to host B.

During transmission, the ip_a, Ip_b, and mac_a are unchanged, while the MAC address of the intermediate node is constantly changing through ARP (M1,M2,M3) until the destination address mac_b.

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.