当前位置:网站首页>What is the difference between IP address and physical address

What is the difference between IP address and physical address

2022-07-07 16:20:00 Full stack programmer webmaster

So-called IP The address is given to each connection at Internet One assigned by the host on 32bit Address . Simply put, it's what you're doing on the Internet ID. MAC(Media Access Control, Media access control ) Address ( Physical address ) It's identification LAN( LAN ) Identification of nodes . The physical address of the network card is usually burned into the network card by the network card manufacturer EPROM( A kind of Flash memory chips , It is usually possible to write by program ), It stores the address of the computer that sends data and the host that receives data when transmitting data . It's your computer ID card ~ This address is determined by the network card , But you can change the physical address of the network card read by the system in the registry .

Mac The address is the address used on the media access layer , Generally speaking, it is the physical address of the network card , current Mac The address is generally 6 byte 48bit( In the early days, there were 2 byte 16bit Of Mac Address ).
   about MAC Address , Because we don't contact it directly , So you may not be very familiar . stay OSI(Open System Interconnection, Open Systems Interconnection )7 Layer network protocol ( The physical layer , Data link layer , The network layer , Transport layer , The session layer , The presentation layer , application layer ) In the reference model , The second layer is the data link layer (Data Link). It contains two sub layers , The upper layer is logical link control (LLC:Logical Link Control), The next level is what we mentioned earlier MAC(Media Access Control) layer , Media access control layer . The so-called medium (Media),
 It refers to the various physical environments through which signals are transmitted . Common network media include cables ( Such as : Twisted pair , Coaxial cable , Optical fiber ),
 And microwaves 、 laser 、 Infrared, etc , Sometimes called physical media .MAC Address is also called physical address 、 Hardware address or link address , Written inside the hardware when produced by a network device manufacturer . This address has nothing to do with the network ,
 That is, regardless of the hardware that will have this address ( Such as network card 、 A hub 、 Router, etc ) Where to access the network , It all has the same MAC Address ,MAC The address is generally unalterable , It cannot be set by the user .
   MAC Before the address 24 It is from the manufacturer to IEEE The address of the manufacturer applying . after 24 The position is decided by the manufacturer .( In the early 2 Bytes without application )
    One :IP Address and Mac What are the connections and differences between addresses 
   about IP Address , I believe everyone is familiar with , It means to use TCP/IP Protocol assigned to the host 32 Bit address .IP The addresses are separated by dots 4 individual 8 It's made up of octets , Such as 192.168.0.1 It's just one. IP Address , This is called dotted decimal format .IP The address consists of network address and host address , The number of bits allocated to these two parts varies with the address class (A class 、B class 、C Class etc. ) Different but different . Network address is used for routing , The host address is used to find a separate host within the network or subnet . One IP The address makes it possible to route data from the source address to the destination address .
    Nowadays, many computers are built through local area networks , Then through the switch and Internet Connected . Then assign each user a fixed IP Address , Managed by the management center , In order to facilitate management, you need to use Mac Address to mark the user , Prevent confusion , Clear responsibility ( For example, cyber crime ). in addition IP Address and Mac The address is different , Although they are one-to-one correspondence in the LAN .IP The address is based on the current IPv4 Specified standards , Addresses that are easy to remember without hardware restrictions , and Mac The address is the physical address of the network card , It has something to do with hardware , It's hard to remember .
  MAC The length of the address is 48 position (6 Bytes ), Usually expressed as 12 individual 16 Hexadecimal number , Every time 2 individual 16 The base numbers are separated by colons , Such as :08:00:20:0A:8C:6D It's just one. MAC Address , The top 6 position 16 Hexadecimal number 08:00:20 The number representing the network hardware manufacturer , It consists of IEEE(Istitute of Electrical and Electronics Engineers, Institute of electrical and Electronics Engineers ) Distribute , Then 3 position 16 Hexadecimal number 0A:8C:6D Represents a network product manufactured by the manufacturer ( Such as network card ) My serial number .
 Every network manufacturer must ensure that every Ethernet device it manufactures has the same first three bytes and different last three bytes . This ensures that every Ethernet device in the world has a unique MAC Address .
    Since every Ethernet device comes out of the factory with a unique MAC Address , Then why do you need to allocate another for each host IP The address? ? Or why each host is assigned a unique IP Address , Why in the network device ( Such as network card , A hub , Router, etc ) A unique... Is embedded in production MAC The address? ? The main reasons are as follows :(1)IP The allocation of addresses is based on the topology of the network , Not according to who made the network settings . If the efficient routing scheme is based on the equipment manufacturer rather than the topology of the network , This scheme is not feasible .
(2) When there is an additional layer of address addressing , Equipment is easier to move and maintain .
 for example , If an Ethernet card breaks , Can be replaced , Without having to get a new IP Address . If one IP The host moves from one network to another , You can give it a new IP Address , Without a new network card .
(3) Whether it's a LAN , Or the communication between computers in the WAN , In the end, it is shown that the data packet starts from the initial node on some form of link , Passing from one node to another , Finally, it is transmitted to the destination node .
 The movement of packets between these nodes is caused by ARP(Address Resolution Protocol: Address resolution protocol ) Responsible for IP Address mapping to MAC Address to complete .

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/113209.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071406057503.html