xkonekt
Language: EN
  • English
  • Türkçe
  • Español, Coming soon
  • Português, Coming soon
  • Deutsch, Coming soon
  • Français, Coming soon

Network models · Fundamentals · Module 2

Encapsulation and decapsulation · page 3 of 3

Show topologyHide topology
H1hostSW1switchR1routerH2host10.0.1.0/2410.0.1.0/2410.0.2.0/24eth0Et0/1Et0/0Et0/0Et0/1eth0.10.1.1.20Et0/0 = Ethernet0/0.1 = the last number of the address
Topology · SW1 joins H1 and R1 in one network; R1 joins that network to H2’s.

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

  1. Case 1 · Symptom

    Someone tests 10.0.2.30 from R1, thinking it is H2.

    Output · IOS XE 17.18.2
    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)
    1. 0/5: not one reply.
  2. Case 1 · Command

    With debug ip packet on, R1 printed lines for each test packet. The first one:

  3. Case 1 · Output

    Output · IOS XE 17.18.2
    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)
    1. sending: the network layer has the packet and its way out, Ethernet0/1.
    2. 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
  4. Case 1 · How far it reaches

    Is it only this address? R1’s ARP table:

    Output · IOS XE 17.18.2
    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 —
    1. 10.0.2.20 still has a Hardware Addr, so only 10.0.2.30 is affected.
    2. 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   
  5. Case 1 · What it means

    R1ApplicationTransportNetworkData linkPhysicalpacket builtno MAC addressfor 10.0.2.30
    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.
  6. Case 1 · Fix

    Test H2’s real address, 10.0.2.20, as in the topology.

  7. Case 1 · Proof

    On R1, the test to 10.0.2.20:

    Output · IOS XE 17.18.2
    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
    1. 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)

  1. Case 2 · Symptom

    Since this morning, R1 cannot reach H2.

    Output · IOS XE 17.18.2
    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)
    1. 0/5: not one reply.
  2. Case 2 · Command

    Run commands to narrow the cause, then choose it.

    Choose the next command

    Output · IOS XE 17.18.2
    R1#show logging | include IP:IP: s=10.0.1.1 (local), d=10.0.2.20 (nil), len 100, unroutable
    Output · IOS XE 17.18.2
    R1#show ip interface Ethernet0/1 | include Internet address  Internet address is 10.0.2.1/30
    Output · IOS XE 17.18.2
    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
    Output · IOS XE 17.18.2
    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 down
    Full 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    
    Output · IOS XE 17.18.2
    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
    Output · IOS XE 17.18.2
    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
    Output · IOS XE 17.18.2
    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
    Cause
  3. Answer to see what it means, the fix and the proof.

  4. 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.

    Output · IOS XE 17.18.2
    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
    1. 5/5, all five replies came back.
  5. Case 2 · What it means

    R1ApplicationTransportNetworkData linkPhysical10.0.2.20 is outside10.0.2.0/30not reached
    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.
  6. Case 2 · Fix

    Give Ethernet0/1 its /24 mask again. On R1 that is configure terminal, then interface Ethernet0/1, then ip address 10.0.2.1 255.255.255.0, then end. The new line takes the place of the old one, so afterwards the interface has one ip address line. The prompt shows where you are: R1(config)#, then R1(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.

    Output · IOS XE 17.18.2
  7. Case 2 · Proof

    After the fix, R1 tests H2 again:

    Output · IOS XE 17.18.2
    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
    1. 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:

Three line endings and the next check
Line ends inMeansLook next
encapsulation failedno frame: the data link layershow arp: Incomplete for that address
sending full packetthe packet went outshow arp Hardware Addr, then the far side
unroutableno way out: the network layerthe 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

Which PDU carries a trailer?
H2’s network layer has just removed the IP header. What does it hand up, and to which layer?
Which header holds the field that says which program on H2 gets the data?

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.

Output · IOS XE 17.18.2
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
R1’s line for a packet to another address ends in unroutable. At which layer did it stop, and what do you check first?
Ethernet0/1 reads /30. Which line, under interface Ethernet0/1, is accepted by R1, keeps 10.0.2.1 and puts 10.0.2.20 back inside its network?

Summary

R1H2ApplicationTransportNetworkData linkPhysicalApplicationTransportNetworkData linkPhysicalbitsthe PDU:data
Figure 2.2, recap · H2’s transport layer: port 2001 belongs to a program of its own. It removes the TCP header; the program gets “hello from R1”.

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 unroutable shows a packet that stopped at layer 3; a line that ends in encapsulation failed, one that stopped at layer 2.

Commands

  • debug ip packet detailnot read-only

    a 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 arp

    Hardware Addr: the MAC address behind each IP address; Incomplete when nobody answered.

  • show interfaces <interface> | include address|Encapsulation|MTU

    the interface’s own MAC address and the kind of frames it sends.

  • show ip interface <interface> | include Internet address

    the address and mask that set the interface’s network.