Network models · Fundamentals · Module 1
Layers: the OSI and TCP/IP models · 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
Find the layer that stopped
R1 cannot reach the program on H2. Which layer stopped?
Check from the bottom, because each layer needs the one below it. The first layer that fails is where to look; everything above it fails with it. You can use the same order when a web page will not load on your own computer, though some web servers do not answer pings.
Case 1 of 2.H2’s program does not answer
Two columns of layers, as in Figure 1.3: R1 on the left, H2 on the right, each with Application, Transport, Network, Data link and Physical from top to bottom, and a cable between the two physical layers, from R1’s Et0/1 to H2’s eth0. H2’s application layer is crossed out. A note under R1 reads “ping: OK (layers 1–3)”; a note under H2 reads “port 2001: refused”.
Case 1 · Symptom
R1 tries to connect to port 2001 on H2 and gets no greeting.
R1#telnet 10.0.2.20 2001Trying 10.0.2.20, 2001 ... 1% Connection refused by remote host
% Connection refused by remote host: H2 answered and refused the connection.
Case 1 · Command
Check the layers below first. On R1,
ping10.0.2.20 tests whether the network layer gets through to H2.Case 1 · Output
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:1!!!!!2Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
- A reply for every test packet.
- Key line
5/5means layer 3 gets through to H2, so H2 itself refused the connection.
Case 1 · How far it reaches
R1’s side, its interface toward H2:
R1#show interfaces Ethernet0/11Ethernet0/1 is up, line protocol is up Hardware is AmdP2, address is aabb.cc00.0910 (bia aabb.cc00.0910)2 Internet address is 10.0.2.1/24… 24 more lines (see Full output)
upandup: layers 1 and 2 work.- The address and mask are as in the topology: the layer-3 setting is right.
Full output · 27 lines
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/24 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:00, output 00:00:00, output hang never Last clearing of "show interface" counters 00:01:52 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 91 packets input, 9870 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 98 packets output, 10319 bytes, 0 underruns Output 0 broadcasts (0 IP multicasts) 0 output errors, 0 collisions, 0 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
Case 1 · What it means
- The connection to port 2001 was refused because, with no program waiting on that port, H2’s TCP answers the connection attempt with a reset, a refusal. H2’s transport layer still answered, so the stop is the program above it.
- Nothing on R1 needs to change. R1 writes no log message about this fault; the connection test is what shows it.
Case 1 · Fix
Whoever runs H2 starts the program on port 2001 again.
Case 1 · Proof
On R1, the same connection test, after the program was started again:
R1#telnet 10.0.2.20 20011Trying 10.0.2.20, 2001 ... Open2hello from H2
Open: the connection to port 2001 is accepted.- The greeting arrives: the application layer works again.
End of case 1. Solved: the program on H2 answers again.
Case 2 of 2.R1 cannot reach H2 at all (your turn)
Case 2 · Symptom
R1’s pings to H2 get no reply, and the connection to port 2001 fails too.
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 interfaces Ethernet0/1Check from the bottom: the first line ofshow interfacesanswers for layers 1 and 2 at once.R1#show interfaces Ethernet0/11Ethernet0/1 is administratively down, line protocol is down Hardware is AmdP2, address is aabb.cc00.0910 (bia aabb.cc00.0910)2 Internet address is 10.0.2.1/24 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:25, output 00:00:25, output hang never Last clearing of "show interface" counters 00:02:38 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 116 packets input, 12446 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 126 packets output, 13091 bytes, 0 underruns Output 0 broadcasts (0 IP multicasts) 0 output errors, 0 collisions, 0 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
- The first line: layers 1 and 2 on Ethernet0/1.
- The Internet address line: the layer-3 setting.
R1#show ip interface briefInterface Ethernet0/0IP-Address 10.0.1.1OK? YESMethod TFTPStatus upProtocol up1Interface Ethernet0/1IP-Address 10.0.2.1OK? YESMethod TFTPStatus administratively downProtocol downInterface Ethernet0/2IP-Address unassignedOK? YESMethod unsetStatus administratively downProtocol downInterface Ethernet0/3IP-Address unassignedOK? YESMethod unsetStatus administratively downProtocol down- Ethernet0/1, toward H2: Status is layer 1, Protocol is layer 2.
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 TFTP administratively down down 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 logging | include LINK|LINEPROTO1Nov 25 21:10:20.691: %LINK-5-CHANGED: Interface Ethernet0/1, changed state to administratively downNov 25 21:10:21.691: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to down
%LINK-5-CHANGED: when Ethernet0/1 changed state, and to which state.
R1#show running-config interface Ethernet0/1Building configuration... Current configuration : 111 bytes!interface Ethernet0/1 ip address 10.0.2.1 255.255.255.0… 1 more line (see Full output) shutdown… 1 more line (see Full output)end
Full output · 10 lines
R1#show running-config interface Ethernet0/1Building configuration... Current configuration : 111 bytes!interface Ethernet0/1 ip address 10.0.2.1 255.255.255.0 no ip route-cache cef shutdown no keepaliveend
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/1 ms
5/5: R1’s side toward H1.
R1#telnet 10.0.2.20 2001Trying 10.0.2.20, 2001 ... 1% Destination unreachable; gateway or host down
% Destination unreachable: R1 did not reach H2 at all, so not even a refusal came back.
How to reason it out
Bottom first: layers 1 and 2 are down on R1’s Ethernet0/1.
The running configuration shows the
shutdownline, and the log shows%LINK-5-CHANGEDat the moment it happened.Answer to see what it means, the fix and the proof.
Case 2 · How far it reaches
With Ethernet0/1 still off, R1 tests H1, on its other side:
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/1 ms
Case 2 · What it means
Figure 1.5 · With layer 1 off on R1’s Ethernet0/1, no layer above it can reach H2. The same two columns of layers: R1 on the left, H2 on the right. R1’s physical layer is crossed out, and the cable from R1’s Et0/1 to H2’s eth0 is drawn as usual; the cross marks R1’s end. Every layer of H2 is dimmed. A note under R1 reads “Et0/1: turned off”; a note under H2 reads “no reply”.
- The fault is on one interface, Ethernet0/1, and so is the fix.
Case 2 · Fix
Turn Ethernet0/1 on again. On R1 that is
configure terminal, theninterface Ethernet0/1, thenno shutdown, thenendbefore the show commands. The prompt, the text R1 prints when it is ready for a command, shows where you are:R1(config)#, thenR1(config-if)#for the interface.Type a command, or tap one in the list, then run it. The list stays the same in every mode: the commands that read R1’s state, the tests and
configure terminal. Afterconfigure terminal, type the configuration lines yourself.Ticket: Since this morning R1 cannot reach H2. Find the layer that stopped on R1 and bring the link back.
Case 2 · Proof
After the fix, the first line of
show interfaceson R1:R1#show interfaces Ethernet0/11Ethernet0/1 is up, line protocol is up … 26 more lines (see Full output)
up, line protocol is up: layers 1 and 2 work again, so the ping and the connection test can get through.
Full output · 27 lines
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/24 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:00, output 00:00:00, output hang never Last clearing of "show interface" counters 00:03:58 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 129 packets input, 13856 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 142 packets output, 14699 bytes, 0 underruns Output 4 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
End of case 2. Solved: Ethernet0/1 is up again at layers 1 and 2.
What both cases share follows once you have answered case 2.
Both cases
| Command | Layers | Good | Broken |
|---|---|---|---|
show interfaces, first line | 1 and 2 | up, line protocol is up | administratively down or down |
show interfaces, Internet address line | 3 setting | the address and mask in the topology | another address or mask |
ping the far host | 3, to the far host | !!!!! | ..... |
telnet the far host and port | the layers above | Open and the program’s data | refused |
| Message | Means | Look first |
|---|---|---|
%LINK-5-CHANGED … administratively down | turned off with shutdown | first line of show interfaces, then the interface’s configuration |
%LINEPROTO-5-UPDOWN … down | line protocol down | first line of show interfaces |
% Connection refused by remote host | no program waits on that port | the far host’s program |
% Destination unreachable; gateway or host down | the host was not reached | first line of show interfaces, then ping |
Check
R1 on another day.
Tap a line, or “Not in the output”, then submit.
Of the interfaces in the topology, find the one whose layers 1 and 2 are down.
Full output · 5 lines
R1#show ip interface briefInterface IP-Address OK? Method Status ProtocolEthernet0/0 10.0.1.1 YES TFTP administratively down down 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
Summary
Two columns of layers, R1 on the left and H2 on the right, each with Application, Transport, Network, Data link and Physical, joined by a cable between the two physical layers. Arrows go down R1’s column and across the cable, drawn faint, and up H2’s column from Physical to Application, where H2’s application layer is drawn in the accent color.
- OSI’s seven layers each do one job; TCP/IP does the same jobs in four layers. Layer 2 works within one network, layer 3 across networks, layer 4 picks the program.
- Going down, each layer hands its result to the one below; arriving, each undoes it from the bottom. The header a layer adds on R1 is read by the same layer on H2.
- The first line of
show interfacesanswers for layers 1 and 2, the Internet address line is the layer-3 setting, a ping proves layer 3 to the far host, and the program’s answer proves the rest. - Check from the bottom: the first layer that fails is the one to fix.
Commands
show interfaces <interface>the first line for layers 1 and 2; the Internet address line for the layer-3 setting.
show ip interface briefStatus and Protocol of every interface at once.
ping <address>the success line: layer 3 to the far host.
telnet <address> <port>not read-onlyOpenorrefused: whether a program waits on that port. Opens one connection.show logging | include LINK|LINEPROTOwhen an interface changed state.