Network models · Fundamentals · Module 2
Encapsulation and decapsulation · page 3 of 3
Show topologyHide topology
Four devices in a column, joined by three cables. At the top the host H1: its eth0, address ending .10, is cabled to the switch SW1’s Et0/1. SW1’s Et0/0 is cabled to the router R1’s Et0/0, address ending .1. Both of SW1’s cables are one network, 10.0.1.0/24, written on each of them; SW1 itself has no address. R1’s Et0/1, address ending .1, is cabled to the host H2 at the bottom, its eth0 ending .20, in the network 10.0.2.0/24, written on that cable. A legend explains the short forms.
Troubleshoot
Where did the packet stop?
R1 sends a packet, and nothing comes back. Where did it stop?
Going down R1’s layers, a packet can stop at the network layer, when R1 has no way out for it, or at the data link layer, when R1 cannot build the frame. The end of R1’s packet line shows how far down R1’s layers the packet got.
Case 1 of 2.No frame for 10.0.2.30
Case 1 · Symptom
Someone tests 10.0.2.30 from R1, thinking it is H2.
R1#ping 10.0.2.30Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.2.30, timeout is 2 seconds:.....1Success rate is 0 percent (0/5)
0/5: not one reply.
Case 1 · Command
With
debug ip packeton, R1 printed lines for each test packet. The first one:Case 1 · Output
R1#show logging | include IP:… 1 more line (see Full output)1IP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, sending2IP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, encapsulation failed… 12 more lines (see Full output)
sending: the network layer has the packet and its way out, Ethernet0/1.- Key line R1 knows the way out but cannot build the frame (
encapsulation failed).
Full output · 15 lines
R1#show logging | include IP:IP: tableid=0, s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1) nexthop=10.0.2.30, routed via FIBIP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, sendingIP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, encapsulation failedIP: tableid=0, s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1) nexthop=10.0.2.30, routed via FIBIP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, sendingIP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, encapsulation failedIP: tableid=0, s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1) nexthop=10.0.2.30, routed via FIBIP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, sendingIP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, encapsulation failedIP: tableid=0, s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1) nexthop=10.0.2.30, routed via FIBIP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, sendingIP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, encapsulation failedIP: tableid=0, s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1) nexthop=10.0.2.30, routed via FIBIP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, sendingIP: s=10.0.2.1 (local), d=10.0.2.30 (Ethernet0/1), len 100, encapsulation failed
Case 1 · How far it reaches
Is it only this address? R1’s ARP table:
R1#show arpProtocol InternetAddress 10.0.1.1Age (min) -Hardware Addr aabb.cc00.0900Type ARPAInterface Ethernet0/0Protocol InternetAddress 10.0.1.10Age (min) 5Hardware Addr 5254.0000.0110Type ARPAInterface Ethernet0/0Protocol InternetAddress 10.0.2.1Age (min) -Hardware Addr aabb.cc00.0910Type ARPAInterface Ethernet0/11Protocol InternetAddress 10.0.2.20Age (min) 1Hardware Addr 5254.0000.0220Type ARPAInterface Ethernet0/12Protocol InternetAddress 10.0.2.30Age (min) 0Hardware Addr IncompleteType ARPAInterface —- 10.0.2.20 still has a Hardware Addr, so only 10.0.2.30 is affected.
Incomplete: R1 asked for the MAC address of 10.0.2.30 and got no answer.
Full output · 6 lines
R1#show arpProtocol Address Age (min) Hardware Addr Type InterfaceInternet 10.0.1.1 - aabb.cc00.0900 ARPA Ethernet0/0Internet 10.0.1.10 5 5254.0000.0110 ARPA Ethernet0/0Internet 10.0.2.1 - aabb.cc00.0910 ARPA Ethernet0/1Internet 10.0.2.20 1 5254.0000.0220 ARPA Ethernet0/1Internet 10.0.2.30 0 Incomplete ARPA
Scroll sideways to see the whole output
Case 1 · What it means
Figure 2.5 · The packet is built, but without a MAC address for 10.0.2.30 no frame is made. R1’s column of layers: Application, Transport, Network, Data link and Physical, from top to bottom. Application and Transport are dimmed, because a ping’s test packet is made by the network layer itself. An arrow goes from Network down to Data link. Data link is crossed out, and Physical below it is dimmed. A note right of Network, tied to it by a thin line, reads “packet built”; a note right of Data link reads “no MAC address for 10.0.2.30”.
- The data link layer needs the destination’s MAC address on this link, and no device here has 10.0.2.30, so the packet never leaves R1.
Case 1 · Fix
Test H2’s real address, 10.0.2.20, as in the topology.
Case 1 · Proof
On R1, the test to 10.0.2.20:
R1#ping 10.0.2.20Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.2.20, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
5/5: each test packet got a frame and a reply.
End of case 1. Solved: the test now goes to H2’s real address and gets replies.
Case 2 of 2.R1’s packets to H2 stop (your turn)
Case 2 · Symptom
Since this morning, R1 cannot reach H2.
R1#ping 10.0.2.20Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.2.20, timeout is 2 seconds:.....1Success rate is 0 percent (0/5)
0/5: not one reply.
Case 2 · Command
Run commands to narrow the cause, then choose it.
Choose the next command
Best next command:
R1# show logging | include IP:Start with R1’s packet line: its last words show where the packet stopped.R1#show logging | include IP:IP: s=10.0.1.1 (local), d=10.0.2.20 (nil), len 100, unroutable
R1#show ip interface Ethernet0/1 | include Internet address Internet address is 10.0.2.1/30
R1#show running-config interface Ethernet0/1… 4 more lines (see Full output)interface Ethernet0/1 ip address 10.0.2.1 255.255.255.252… 2 more lines (see Full output)end
Full output · 9 lines
R1#show running-config interface Ethernet0/1Building configuration... Current configuration : 103 bytes!interface Ethernet0/1 ip address 10.0.2.1 255.255.255.252 no ip route-cache cef no keepaliveend
R1#show ip interface briefInterface Ethernet0/0IP-Address 10.0.1.1OK? YESMethod TFTPStatus upProtocol upInterface Ethernet0/1IP-Address 10.0.2.1OK? YESMethod manualStatus upProtocol upInterface Ethernet0/2IP-Address unassignedOK? YESMethod unsetStatus administratively downProtocol downInterface Ethernet0/3IP-Address unassignedOK? YESMethod unsetStatus administratively downProtocol downFull output · 5 lines
R1#show ip interface briefInterface IP-Address OK? Method Status ProtocolEthernet0/0 10.0.1.1 YES TFTP up up Ethernet0/1 10.0.2.1 YES manual up up Ethernet0/2 unassigned YES unset administratively down down Ethernet0/3 unassigned YES unset administratively down down
Scroll sideways to see the whole output
R1#show interfaces Ethernet0/1Ethernet0/1 is up, line protocol is up Hardware is AmdP2, address is aabb.cc00.0910 (bia aabb.cc00.0910) Internet address is 10.0.2.1/30 MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive not set ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:36, output 00:00:30, output hang never Last clearing of "show interface" counters 00:05:49 Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue: 0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 210 packets input, 22496 bytes, 0 no buffer Received 0 broadcasts (0 IP multicasts) 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 input packets with dribble condition detected 243 packets output, 24566 bytes, 0 underruns Output 12 broadcasts (0 IP multicasts) 0 output errors, 0 collisions, 1 interface resets 0 unknown protocol drops 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out
R1#show arpProtocol Address Age (min) Hardware Addr Type InterfaceInternet 10.0.1.1 - aabb.cc00.0900 ARPA Ethernet0/0Internet 10.0.1.10 6 5254.0000.0110 ARPA Ethernet0/0Internet 10.0.2.1 - aabb.cc00.0910 ARPA Ethernet0/1
R1#ping 10.0.1.10Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.10, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
How to reason it out
The packet line ends in
unroutable, and(nil)afterd=means no interface out, so R1 found no way out. That is the network layer; nosendingline follows.On R1 the network layer picks the way out from each interface’s address and mask. Ethernet0/1 reads /30: its network is 10.0.2.0/30, and 10.0.2.20 is not in it. A /30 leaves only the last two bits for the host part, so 10.0.2.0/30 holds only 10.0.2.0 to 10.0.2.3.
R1’s side of Ethernet0/1 is up at layers 1 and 2:
upandup, so it is not turned off. R1 still reaches 10.0.1.10 on its other side.Answer to see what it means, the fix and the proof.
Case 2 · How far it reaches
Does the fault reach beyond this link? R1 tests H1, on its other side:
Only the way toward H2 is broken.
R1#ping 10.0.1.10Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.10, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
5/5, all five replies came back.
Case 2 · What it means
Figure 2.6 · The second case in R1’s layers: Network crossed out, the layers below not reached. The same column of R1’s layers as in Figure 2.5. Network is crossed out. Application and Transport are dimmed, and so are Data link and Physical below Network. A note right of Network, tied to it by a thin line, reads “10.0.2.20 is outside 10.0.2.0/30”; a note right of Data link reads “not reached”.
- The packet stopped at the network layer: R1 had no way out for 10.0.2.20.
Case 2 · Fix
Give Ethernet0/1 its /24 mask again. On R1 that is
configure terminal, theninterface Ethernet0/1, thenip address 10.0.2.1 255.255.255.0, thenend. The new line takes the place of the old one, so afterwards the interface has oneip addressline. The prompt shows where you are:R1(config)#, thenR1(config-if)#for the interface.Type a command, or tap one, then run it.
Ticket: R1 cannot reach H2 since someone retyped Ethernet0/1’s address. Make R1’s packets to H2 leave again.
Case 2 · Proof
After the fix, R1 tests H2 again:
R1#ping 10.0.2.20Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.2.20, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
5/5: the packets get a way out, a frame and a reply.
End of case 2. Solved: R1’s packets to H2 leave again.
What both cases share follows once you have answered case 2.
Both cases
To find where a packet stopped, run debug ip packet, one ping to the far host, show logging | include IP: and undebug all, then read the last words of the IP line:
| Line ends in | Means | Look next |
|---|---|---|
encapsulation failed | no frame: the data link layer | show arp: Incomplete for that address |
sending full packet | the packet went out | show arp Hardware Addr, then the far side |
unroutable | no way out: the network layer | the address and mask in show running-config interface Ethernet0/1 |
Ethernet0/1 carried pings to H2, yet the test packet to 10.0.2.30 never left R1. Up and up in show ip interface brief shows R1’s side works at layers 1 and 2, not that packets leave it.
Check
R1 on another day, testing H1 at 10.0.1.10, which does not answer.
Tap a line, or “Not in the output”, then submit.
Find the line that shows this test packet went out of R1.
R1#show logging | include IP:… 3 more lines (see Full output)
Full output · 6 lines
R1#show logging | include IP:IP: tableid=0, s=10.0.1.1 (local), d=10.0.1.10 (Ethernet0/0) nexthop=10.0.1.10, routed via FIBIP: s=10.0.1.1 (local), d=10.0.1.10 (Ethernet0/0), len 100, sendingIP: s=10.0.1.1 (local), d=10.0.1.10 (Ethernet0/0), len 100, sending full packetIP: tableid=0, s=10.0.1.1 (local), d=10.0.1.10 (Ethernet0/0) nexthop=10.0.1.10, routed via FIBIP: s=10.0.1.1 (local), d=10.0.1.10 (Ethernet0/0), len 100, sendingIP: s=10.0.1.1 (local), d=10.0.1.10 (Ethernet0/0), len 100, sending full packet
Summary
Two columns of layers, R1 on the left and H2 on the right, joined by a cable. R1’s layers, the cable and H2’s lower layers are dimmed: the PDU has passed them. H2’s Transport layer, the layer at work, is drawn in the accent color, with arrows up to it and on to Application. In the strip below, only “data” is left: every header has been removed on the way up.
- Going down, the transport, network and data link layers each put a header in front of what they got, and the data link layer also adds a trailer. The PDUs are data, segment, packet, frame and bits.
- R1 adds the three headers on the way down to bits; H2 checks and removes each header from the bottom, and each header’s “what is inside” field names which part gets the rest.
- Read a frame’s headers from the outside in: MAC addresses, IP addresses, ports. R1’s packet lines start at the IP header.
- A line that ends in
unroutableshows a packet that stopped at layer 3; a line that ends inencapsulation failed, one that stopped at layer 2.
Commands
debug ip packet detailnot read-onlya line for each packet the router itself sends or receives. It can load a busy router: keep it short and end it with
undebug all.show logging | include IP:the last words of the IP lines, among them
sending,sending full packet,rcvd 2,encapsulation failed,unroutable.show arpHardware Addr: the MAC address behind each IP address;
Incompletewhen nobody answered.show interfaces <interface> | include address|Encapsulation|MTUthe interface’s own MAC address and the kind of frames it sends.
show ip interface <interface> | include Internet addressthe address and mask that set the interface’s network.