For the tcp ip protocol, we do not strictly regulate its hardware or other designs. It is widely used and its conceptual application is relatively vague. Now we will introduce the address query in its linux system.
To allow the tcp ip protocol to communicate smoothly with different types of hardware, we need to establish some standard protocols for your reference. Taking the most common Ethernet network as an example, we don't have to worry about how vendors design network interface drivers. Once it is accepted by the system, the network storage layer (Datalink) you can use the network interface to send and receive data on the physical network.
Problems related to IP address and object address
We know that the shipping method used on the Ethernet is CSMA/CD (Carrier-Sensing Multiple Access with Collision Detection): Although the message frame will be in the entire segment (segment) it is transmitted in broadcast mode, and all nodes will receive the message box. However, only the message box with the target address that matches the actual address will be received. Therefore, regardless of the Upper-layer protocol (tcp ip protocol or other Protocols), if Ethernet is used for transmission at the bottom layer, the MAC (Media Access Control) is used) object address. To query the object addresses on all interfaces of the current system, enter the ifconfig command in Linux:
- eth0 Link encap:Ethernet HWaddr 00:A0:0C:11:EA:11
- inet addr:203.30.35.134 Bcast:203.30.35.159 Mask:255.255.255.224
- UP BROADcast RUNNING MULTIcast MTU:1500 Metric:1
- RX packets:0 errors:0 dropped:0 overruns:0 frame:0
- TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:100
- Interrupt:3 Base address:0x300eth1
- Link encap:Ethernet HWaddr 00:80:C7:47:8C:9A
- inet addr:192.168.0.17 Bcast:192.168.0.255 Mask:255.255.255.0
- UP BROADcast RUNNING MULTIcast MTU:1500 Metric:1
- RX packets:12303 errors:0 dropped:0 overruns:0 frame:0
- TX packets:12694 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:100
- Interrupt:10 Base address:0x2e0
From the preceding command results, we can find that the last part of the first line of information about each interface is the object address of the interface. When a message frame is transmitted over a physical network, the IP address (or the interface address) is useless. But the problem is: when we use the TCP/IP protocol, the upper-layer protocols are based on IP addresses for transmission.