By the end of this lesson you can
- Map the OSI layers to the TCP/IP model and name the unit of data at each
- Explain the job of routers, switches, Layer 3 switches, APs, WLCs, firewalls and IPS
- Choose copper, multimode or single-mode fibre for a run
- Compare TCP and UDP and recall the well known ports
- Diagnose duplex and cabling problems from show interfaces
Layers and encapsulation: how data gets wrapped
Lesson 1.4 introduced the layers. The CCNA expects you to use them as a tool: when something breaks, you work out which layer is failing and test that layer. Two models describe the same idea.
As data goes down the stack, each layer adds its own header: the application's data gets a TCP or UDP header (now a segment or datagram), then an IP header (a packet), then an Ethernet header and trailer (a frame), and finally the physical layer turns it into electrical, light or radio signals (bits). The receiver strips the headers in reverse. That is encapsulation and de-encapsulation.
- A switch normally reads up to Layer 2 (MAC addresses in the frame).
- A router reads up to Layer 3 (IP addresses in the packet), and rebuilds a new Layer 2 frame for every hop.
- Firewalls read Layers 3 and 4 (addresses and ports), and next generation firewalls look into Layer 7 (which application, which URL).
What each device does
| Device | Works at | Job |
|---|---|---|
| Layer 2 switch | L2 | Forwards frames by MAC address inside one network (one VLAN). Learns which MAC lives on which port. |
| Router | L3 | Forwards packets by IP address between networks. Chooses the path using its routing table. |
| Layer 3 (multilayer) switch | L2 and L3 | Switches and routes in hardware. Common as the core or distribution layer inside a campus. |
| Access point (AP) | L1 and L2 | Bridges Wi-Fi clients onto the wired network. |
| Wireless LAN controller (WLC) | management | Configures and manages many lightweight APs centrally (lesson 3.13). |
| Firewall / NGFW and IPS | L3 to L7 | Stateful filtering; next generation firewalls add application awareness and intrusion prevention, which blocks known attack patterns inline. |
| Endpoints and servers | all layers | Laptops, phones, cameras and printers; servers provide services like DNS, DHCP, web and file sharing. |
| PoE switch | L1 and L2 | Power over Ethernet: powers phones, cameras and APs over the data cable. |
You will also meet the classic designs. A two tier (collapsed core) campus has access switches connected to a pair of core and distribution switches. A three tier campus separates access, distribution and core. Data centres use spine and leaf, where every leaf switch connects to every spine, so any two servers are the same number of hops apart. A SOHO (small office, home office) network often has one box that is router, switch, AP and firewall at once, and the WAN connects sites to each other and to the cloud.
Cabling, duplex and the physical layer
| Medium | Typical reach | Use it for |
|---|---|---|
| Copper UTP (Cat5e, Cat6, Cat6A) | Up to 100 m per run for common Ethernet | Desks, phones, APs, PoE devices |
| Multimode fibre (MMF) | Hundreds of metres, depending on speed and fibre grade | Inside a building, between floors and racks |
| Single-mode fibre (SMF) | Kilometres | Between buildings, campuses and service providers |
Fibre does not make a single link magically faster; its advantages are distance and immunity to electrical noise. Old Ethernet needed crossover cables between similar devices, but modern ports use Auto-MDIX and work with either cable. In Packet Tracer you still pick the cable type, so the copper straight-through cable is the normal choice between a PC and a switch.
Half and full duplex
Hubs created one shared medium where only one device could talk at a time (half duplex), and collisions were normal. Switch ports are point to point, so both sides talk at once (full duplex) and you should see zero collisions. When one side is set to full and the other falls back to half, you get a duplex mismatch: the link works but is slow, the half duplex side counts collisions and late collisions, and the full duplex side counts CRC and input errors. The fix is to leave both ends on auto, or set both ends the same.
TCP, UDP and the ports you must know
TCP is connection oriented. It sets up a session with a three way handshake, numbers every byte, acknowledges what arrived, resends what was lost and uses a window to control speed. UDP just sends: no handshake, no recovery, very little overhead. That makes UDP right for voice, video, DNS queries and anything where a late packet is useless anyway.
| Port | Protocol | Transport | Note |
|---|---|---|---|
| 20, 21 | FTP | TCP | Cleartext; prefer SFTP |
| 22 | SSH | TCP | Encrypted remote admin |
| 23 | Telnet | TCP | Cleartext passwords: disable it |
| 25 | SMTP | TCP | Mail between servers |
| 53 | DNS | UDP and TCP | TCP for large answers and zone transfers |
| 67, 68 | DHCP | UDP | Server 67, client 68 |
| 69 | TFTP | UDP | No authentication, used for config and image copies |
| 80, 443 | HTTP, HTTPS | TCP (HTTP/3 uses UDP 443) | Web |
| 123 | NTP | UDP | Time sync, vital for log correlation |
| 161, 162 | SNMP | UDP | Monitoring; traps on 162 |
| 514 | Syslog | UDP | Log messages |
Reading interfaces like an engineer
Two commands answer most physical layer questions. show ip interface brief gives one line per interface with its IP and two status words: Status is Layer 1 (is there a working link?) and Protocol is Layer 2 (is the data link working?). show interfaces adds duplex, speed and the error counters.
| Status / Protocol | Means | Check |
|---|---|---|
| up / up | Working | Nothing to fix at L1 and L2 |
| administratively down / down | Someone typed shutdown | no shutdown |
| down / down | No physical link | Cable, the other end, wrong port |
| up / down | Link is there but L2 fails | Encapsulation or keepalive mismatch, a problem at the far end |
In the counters, CRC and input errors rising usually means a bad cable, interference or a duplex mismatch; late collisions on a switched link almost always mean a duplex mismatch. Practise reading them on R1 below. One of its interfaces has a problem.
Missions 0/8
Flashcards: do you remember?
Tap a card to flip it. Try to answer in your head first; recalling is what makes it stick.
Quick quiz
Instant feedback on every answer. Score 70% or more to pass this lesson's quiz.
Q1Which device forwards traffic between different IP networks?
Routers (and Layer 3 switches) route between networks.
Q2A PC's data gets an IP header. What is it called now?
IP adds the Layer 3 header, making a packet.
Q3Which link should you choose between two buildings 3 km apart?
Single-mode fibre covers kilometres.
Q4Which application is best suited to UDP?
Late voice packets are useless, so retransmission does not help.
Q5An interface shows administratively down. Fix?
Administratively down means it was shut down in the config.
Q6You see rising CRC errors on one side and late collisions on the other. Most likely cause?
Classic duplex mismatch symptoms.
Hands-on lab
Packet Tracer lab 3.1: build, cable and read interfaces
You need: Cisco Packet Tracer (free with a Cisco Networking Academy account; version 9.0.1 was the current download on the NetAcad Resource Hub when this lesson was written). Devices: 1 x 2960-24TT switch, 1 x ISR4331 router, 2 x PC-PT, copper straight-through cables.
Simulator lab, zero risk. This lab runs inside Cisco Packet Tracer, so it touches no real network. Packet Tracer is free with a Cisco Networking Academy account (netacad.com). It simulates a subset of Cisco IOS, so where support for a feature is uncertain we say so instead of promising it works.
Topology and addressing
| Device | Interface | IPv4 address / prefix | Default gateway or note |
|---|---|---|---|
| R1 | Gi0/0/0 | 192.168.10.1/24 | n/a |
| PC1 | Fa0 | 192.168.10.11/24 | 192.168.10.1 |
| PC2 | Fa0 | 192.168.10.12/24 | 192.168.10.1 |
Place and cable
Add the devices and cable them as in the diagram. Watch the link lights: switch ports often show orange for a short time before turning green, because they pass through spanning tree states first (lesson 3.5).
Configure R1
Router>enable Router#configure terminal Router(config)#hostname R1 R1(config)#interface GigabitEthernet0/0/0 R1(config-if)#ip address 192.168.10.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#endAddress the PCs
On each PC open Desktop, then IP Configuration, and enter the address, mask and gateway from the table.
Test and watch the layers
From PC1's Command Prompt run
ping 192.168.10.1andping 192.168.10.12. Then switch to Simulation mode, filter for ICMP and ARP, and step through one ping. Open a PDU and match each part to a layer: Ethernet header (L2), IP header (L3), ICMP (the payload).Verify
R1#show ip interface brief R1#show interfaces GigabitEthernet0/0/0 SW1#show interfaces statusOn PC1:
ipconfigandarp -a. The first ping may lose one reply while ARP finds R1's MAC address; that is normal.Force a mismatch and look
SW1(config)#interface FastEthernet0/1 SW1(config-if)#duplex half SW1(config-if)#speed 10 SW1(config-if)#end SW1#show interfaces FastEthernet0/1Read the duplex and speed lines, then set the port back with
duplex autoandspeed auto.
You are done when: R1 Gi0/0/0 is up/up with 192.168.10.1, both PCs ping R1 and each other, and you can point to the L2, L3 and ICMP parts of a PDU in Simulation mode.
Packet Tracer limits and notes
- Packet Tracer does not reliably produce realistic CRC errors or late collisions from a duplex mismatch, so treat step 6 as a where to look exercise, not proof of real error behaviour. UNVERIFIED how the counters react in your version.
- Fibre cables exist in Packet Tracer, but the device needs a fibre capable port or module, and module names vary by model. UNVERIFIED per device.
- Packet Tracer simulates a subset of IOS. If a command here is rejected in your version, note it, skip that step and carry on; the concept still applies to real Cisco gear.
Download the lab checklist (.txt) Print it or keep it open beside Packet Tracer.
Key takeaways
- Each layer adds a header; switches read L2, routers L3, NGFWs up to L7.
- Copper to 100 m, multimode in buildings, single-mode for kilometres.
- Switched links are full duplex with zero collisions; late collisions mean a duplex mismatch.
- TCP is reliable and ordered, UDP is fast and light.
- show ip interface brief first, show interfaces for the details.
Finished the sections, quiz and lab? Mark the lesson complete. Progress is saved only in this browser.