Tcp ip address query command in Linux

Source: Internet
Author: User

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:

 
 
  1. eth0  Link encap:Ethernet HWaddr 00:A0:0C:11:EA:11    
  2. inet addr:203.30.35.134 Bcast:203.30.35.159 Mask:255.255.255.224    
  3. UP BROADcast RUNNING MULTIcast MTU:1500 Metric:1    
  4. RX packets:0 errors:0 dropped:0 overruns:0 frame:0    
  5. TX packets:0 errors:0 dropped:0 overruns:0 carrier:0    
  6. collisions:0 txqueuelen:100    
  7. Interrupt:3 Base address:0x300eth1    
  8. Link encap:Ethernet HWaddr 00:80:C7:47:8C:9A    
  9. inet addr:192.168.0.17 Bcast:192.168.0.255 Mask:255.255.255.0    
  10. UP BROADcast RUNNING MULTIcast MTU:1500 Metric:1    
  11. RX packets:12303 errors:0 dropped:0 overruns:0 frame:0    
  12. TX packets:12694 errors:0 dropped:0 overruns:0 carrier:0    
  13. collisions:0 txqueuelen:100    
  14. 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.

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.