Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MAC address and ARP Protocol

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

MAC:

-effect

Globally, uniquely, identify a network device

-represents

Total 48bit, that is 6 bytes

Represented by hexadecimal

-knot left structure

The 24 bits of the edge, representing the manufacturer's code

24 digits on the right, indicating a device number defined by the manufacturer

Note:

MAC is a physical address and cannot be changed.

Equivalent to the address of a building in the human world.

In the network world, you must rely on both IP and MAC addresses

To uniquely identify a communication device.

In order to be able to get an IP address corresponding to the MAC address, so you need, ARP

ARP:address resolution protocol: address Resolution Protocol

Based on an IP address, the corresponding MAC address is resolved.

2-layer head (MAC/Ethernet head)

Destination MAC + source MAC + type

Destination source type

6Byte 6Byte 2Byte

Layer 2 tail: FCS,frame checksum, frame checksum, total 4Byte

-function:

Parse out the corresponding IP address based on an MAC address

In order to realize the complete encapsulation of the data.

-principle:

1. Source host, sent by broadcast, ARP request packet

2. The target host, after receiving the ARP request packet

First check whether the target MAC of the layer 2 header is the same as yourself.

Or whether it is a broadcast address; if so, analyze 2 layers

The ARP message behind the header: if the "target IP" in it

If you are the same as yourself, you will first match the sender's IP and MAC.

Relationships, record them, and put them in your local ARP table.

3. Then the target host builds and returns ARP as a unicast

Response message

4. The source host, after receiving the ARP response message, proceed with step 2

The same data processing forms the ARP table locally.

-Type:

Ordinary ARP: resolve the corresponding MAC address based on the IP address

Reverse ARP: obtain the corresponding IP address based on the MAC address

Agent ARP

-bona fide agency

-malicious agent

The address requested by ARP:ARP for no reason is self, which is used to discover and connect with yourself.

Use duplicate IP addresses, that is, IP address conflict detection.

-Core list:

ARP table

Relationship between IP address and MAC address

Action

In order to realize the fast encapsulation of the data layer 2 header

Types

Static ARP entries: always exist in the ARP table

Dynamic ARP entries: stored in the ARP table within the valid time

The ARP valid time of network devices is 4 hours.

View

Terminal equipment: arp-a

Network device: display arp | show ip arp

-Note:

The MAC address is all 1, indicating the broadcast MAC address

MAC addresses are all 0, indicating unknown MAC addresses

Routing:

-definition:

Interworking between different network segments is called routing

-implement:

Achieve "routing" through devices with routing capabilities

Such as routers, multilayer switches

-Core:

View the routing table: shoe ip route

Analyze the routing table:

For example:

C 192.168.12.0/24 is directly connected, FastEthernet0/0

192.168.100.1-> 192.168.12.9

How a router works:

1. Routers only care about IP addresses, not MAC addresses

2. The router only cares about the destination IP address, not the source IP address.

3. After receiving the data packet, the "target IP" will be proposed.

Match "routing table entries"

The process is as follows:

# first analyze the subnet mask length of the route entry

# secondly, according to the length of the subnet mask, extract

Corresponding length bits in the destination IP address

# again, compare the proposed bits with the routing entries:

If it is the same, it means that it is matched and forwarded out the corresponding port.

If it is different, it means that it does not match, and the packet is discarded.

Route viewing and configuration:

-View:

Show ip route

-configuration:

Static route configuration:

R1 (config) # ip route 192.168.23.0 255.255.255.0 fas0/0

Ip route 192.168.23.0 255.255.255.0 192.168.12.2

-this configuration is recommended.

ICMP protocol: layer 3

Wrong way of thinking:

The three layers are different. Look at the routing.

Show ip route = target IP

1. Master the data forwarding path under normal circumstances

2. Segmented processing

3. In each segment, troubleshooting is based on OSI model and "data forwarding mode".

Verify the command:

Show IP interface fas0/0- > status of proxy ARP

Show IP interface fas0/0-> check the MAC address of the port

Show IP arp-> View the ARP table

Debug ARP-> View the working process of ARP on the device

Undebug all-- > turn off all debug commands on the device

Debug ip icmp-- > View the working process of ping

R2:

R2 (config) # interface fas0/0

R2 (config-if) # no ip proxy-arp

Recommendations:

When configuring a static route, the next hop uses the IP address

= =

[R1] ip route-static 192.168.3.0 255.255.255.0 192.168.2.0

[R3] ip route-static 192.168.2.0 255.255.255.0 192.168.2.0

Verification and testing:

Display ip routing-table

Ping 192.168.3.3

Ping 192.168.2.1

Open the debug debug command:

Terminal monitor / / enable terminal monitoring function

Terminal debugging / / enable monitoring of debugging

Debugging ip icmp / / enable debugging of icmp

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report