Routers, switches and end devices

Three kinds of device

DeviceIts jobIt works with
End device (PC, laptop, server, phone, printer)Sends and receives the data people actually useIts own IP address
SwitchJoins the devices of one local network (a LAN) togetherMAC addresses (hardware addresses)
RouterJoins different networks together and picks the path between themIP addresses

Think of it like this: A switch is like the corridor inside one office building: it gets a letter from one desk to another desk in the same building. A router is the post office: it takes letters that are going to another building and sends them the right way.

The default gateway

A PC can talk straight to devices in its own network. For anything outside, it hands the packet to the router. That router address is the PC's default gateway. In the network below, PC1 is in 192.168.1.0/24, its gateway is the router at 192.168.1.1, and the server is in a different network, 10.0.0.0/24.

In NetLab

▶ PC1
NetLab Windows-style command prompt. Type help to see the commands.
C:\Users\student>ipconfig

Windows IP Configuration


Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : 
   Link-local IPv6 Address . . . . . : fe80::11db:99de:fbce:36d1%12
   IPv4 Address. . . . . . . . . . . : 192.168.1.10
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1
C:\Users\student>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time<1ms TTL=255
Reply from 192.168.1.1: bytes=32 time<1ms TTL=255
Reply from 192.168.1.1: bytes=32 time<1ms TTL=255
Reply from 192.168.1.1: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\Users\student>tracert 10.0.0.10

Tracing route to 10.0.0.10 over a maximum of 30 hops

  1   <1 ms    <1 ms    <1 ms  192.168.1.1
  2       *     2 ms     2 ms  10.0.0.10

Trace complete.

ipconfig shows PC1's address and gateway. ping checks it can reach the gateway. tracert lists every router on the way to the server: here the packet goes through the router (192.168.1.1) and then arrives.

How ports are named

Every port has a type and a number. Routers and switches let you shorten the name:

Full nameShort formSpeed
FastEthernet0/1Fa0/1, f0/1up to 100 Mb/s
GigabitEthernet0/0Gi0/0, g0/0up to 1 Gb/s (1000 Mb/s)
TenGigabitEthernet1/1Te1/1up to 10 Gb/s

The numbers are slot/port: 0/1 means slot 0, port 1. Switches usually count ports from 1; many routers count from 0.

Tip: On the diagram, the small labels next to each cable show which port it plugs into.

HOME LABS COMMUNITY DASHBOARD