Skip to main content

Computer Networking

This page provides introduction to Computer Networking.

Overview

A Computer Network is digital telecommunications network which allows nodes to communicate. Here is how computer network looks like:

computer-network-1.svg

Switches

For e.g. Catalyst 92009200, Catalyst 36503650.

  • Switches are used to forward traffic within a Local Area Network (LAN).
  • Switches have many network interfaces/ports for the end hosts to connect to (usually 2424+).
  • Provides connectivity to hosts within the same Local Area Network (LAN).
  • Do not provides connectivity between the LANs/over the internet.
  • It uses source MAC address field to populate it's MAC address table. It associates the MAC address with the interface on which the frame was received. This allows switch to learn how to reach other devices on the network.

Routers

For e.g. ISR 10001000, ISR 900900 or ISR 40004000.

  • Routers are used to provide connectivity between Local Area Network (LAN) and therefore used to send data over the internet.
  • Routers have fewer network interfaces than switches.
  • Routers provides basic security features.

Firewall

For e.g. ASA55005500-X, Firepower 21002100.

  • Firewalls are specialty network security devices that control network traffic entering and existing your network.
  • Firewalls can be placed outside of your router or inside of your network.
  • Firewalls must be configured with security rules to determine which traffic should be allowed and which should be denied.

There are two types of firewalls

  • Network Firewalls: It is hardware device that filter traffic between networks.
  • Host based Firewalls: It is software applications that filter traffic entering and existing a host machine.

Ethernet

Ethernet is a widely used technology for networking, providing reliable, fast, and efficient data communication between devices in a local area network (LAN). It defines the hardware (cables, connectors) and protocols for communication in wired networks.

Ethernet uses RJ-4545 as an interface. It is 88-pin modular connector with 88 positions and 88 contacts (88P88C). Below table shows pins on which each device receives and transmits the data:

DeviceTransmit PinsRecieve Pins
Router11 and 2233 and 66
Firewall11 and 2233 and 66
PC11 and 2233 and 66
Switch33 and 6611 and 22

Copper cables using ethernet standard are called Unshielded Twisted Pair (UTP) cables. It has 44 pairs of cables twisted together, which makes 88 wires in total. Ethernet and Fast Ethernet uses 22 pairs or 44 wires. Gigabit Ethernet and 1010 Gig Ethernet uses all 44 pairs of UTP cables.

Below are ethernet standards for copper cables:

SpeedCommon NameIEEE StandardInformal NameMaximum Length
1010 MbpsEthernet802.3802.3i1010BASE-T100100 m
100100 MbpsFast Ethernet802.3802.3u100100BASE-T100100 m
11 GbpsGigabit Ethernet802.3802.3ab10001000BASE-T100100 m
1010 Gbps1010 Gig Ethernet802.3802.3an1010GBASE-T100100 m
info

11 byte = 88 bits

The speed of a connection is measured in bits per second, not bytes, using units like Kbps, Mbps, Gbps, etc. In contrast, data on a hard drive is measured in bytes per second.

Copper UTP wiring can transmit data over distances of up to 100 meters. For larger networks, fiber optic connections are preferred. Unlike copper wiring, which uses electrical signals, fiber optic cables transmit data as light through glass

Copper UTP cables use separate wire pairs within the cable for transmitting and receiving data. In contrast, fiber optic cables rely on separate cables for these functions.

Below are ethernet standards for fibre optics cables:

SpeedIEEE StandardInformal NameMaximum LengthCable Type
11 Gbps802.3802.3z10001000BASE-LX550550 m - 55kmMultimode Or Single Mode
1010 Gbps802.3802.3ae1010GBASE-SR400400 mMultimode
1010 Gbps802.3802.3ae1010GBASE-LR1010 kmSingle Mode
1010 Gbps802.3802.3ae1010GBASE-ER3030 kmSingle Mode

OSI Model

OSI stands for Open System Interconnection Model. It is a conceptual model that categorizes and standardizes the different functions in a network. Functions are divided into 77 layers. Application developer works with the top 33 layers of OSI model and Network Engineer works with last 44 layers of OSI model.

Below are 77 layers of OSI model:

Application:

  • Application layer is closest to end user and intereacts with software applications.
  • HTTP & HTTPS are layer 77 protocols.
  • For example identifying communication partners and synchronizing communication.

Presentation:

  • Presentation layer translate between application and network formats.
  • For example encryption of data as it is sent, and decrypting the data as it is received.

Session

  • Session layer Establishes, manages, and terminates connections between local application and remote applications.

Transport

  • Transport layer segments and reassembles the data for communications between end hosts.
  • It adds header to data and each data plus header combination is called segment.

Network

  • Network layer provides connectivity between end hosts on different networks.(i.e. outside the LAN).
  • It provides logical addressing(IP addresses) and path selection between source and destination.
  • It addes Layer 33 header, which includes information like source and destionation IP address to the segment.
  • Combination of Data, layer 44 header, and layer 33 header is called packet.
  • Routers operates at layer 33.
  • Data Link layer provides node to node connectivity and data transfer (for example, PC to Switch, Switch to Router, Router to Router).
  • It defines how data is formatted for transmission over a physical medium(for example, copper UTP cables).
  • It also detects and possibly corrects physical layer errors.
  • Like layer 33 layer 22 also uses addressing.
  • Layer 22 adds layer 22 header and layer 22 trailer to packet and it is called frame.
  • Switches operates at layer 22.

Physical

  • Defines physical characteristics of the medium used to transfer data between devices. For example voltage level, maximum transmission distance, physical connectors, cable specifications etc.
  • Digital bits are converted into electrical signals(for wired connections) or radio signals(for wireless connections).
  • Cables and Pins operates at layer 11.

TCP/IP Suite

Conceptual model and set of communications protocols used in the internet and other networks. There are only 44 layers in TCP/IP protocol.

The diagram below illustrates the comparison between the OSI model and the TCP/IP model:

computer-network-2.svg

Local Area Networks (LANs)

It is a network contained with relatively small area. For example office network. Routers are used to connect LANs.

Media Access Control (MAC) Address

  • Mac address is 66-byte (4848-bit) physical address assigned to device when it is made.
  • It is also know as Burned-In-Address.
  • It is globally unique.
  • The first 33 bytes are the OUI(organizationally Unique Identifier), which is assigned to the company making the device.
  • The last 33 bytes are unique to the device itself.

Ethernet LAN Switching

Let's say we have ethernet setup as shown in below diagram:

computer-network-3.svg

Now, suppose PC11 wants to send data to PC33. The Ethernet frame will include the following MAC and IP addresses:

Source IP: 192.168.1.01
Destination IP: 192.168.1.03
Source MAC: 002F.B012.1001
Destination MAC: FFFF.FFFF.FFFF # This is broadcast MAC address

The destination MAC address is initially unknown because PC11 does not know PC33's MAC address. However, since switches are layer 22 devices that operate using MAC addresses, PC11 must first learn PC33's MAC address.

ARP Process

To learn the MAC address, PC11 uses the Address Resolution Protocol (ARP). It sends an ARP request, and PC33 responds with an ARP reply. The ARP request is a broadcast message sent to all hosts on the network, while the ARP reply is a unicast message sent only to PC11.

Steps:

  • PC11 sends an ARP request on its interface (G0/1), which is received by Switch 11.

  • Upon receiving the ARP request, Switch 11 adds PC11's MAC address to its MAC address table. This entry is called a dynamic MAC address because it is learned automatically.

  • Since the destination MAC address is a broadcast address (FFFF.FFFF.FFFF), Switch 11 forwards the ARP request to all its network interfaces except the one on which it was received.

  • PC22 receives the ARP request but discards it since the destination IP does not match its own.

  • Switch 22 receives the ARP request and adds PC11's MAC address to its MAC address table.

  • Since the destination MAC address is a broadcast, Switch 22 also forwards the ARP request to all its network interfaces except the one it came from.

  • PC44 discards the frame for the same reason as PC22.

  • PC33 recognizes that the destination IP matches its own. It processes the ARP request and sends an ARP reply frame with the following details:

Source IP: 192.168.1.03
Destination IP: 192.168.1.01
Source MAC: 002F.B012.2001
Destination MAC: 002F.B012.1001
  • Switch 22 receives the ARP reply, updates its MAC address table with PC33's MAC address, and forwards the reply to Switch 11.

  • Switch 11 forwards the ARP reply to PC11 since it knows that PC11's MAC address is associated with the G0/1 interface.

  • PC11 receives the ARP reply and stores an entry for PC33 in its ARP table, associating PC33's IP address with its MAC address.

PC11 can now use this information to send data directly to PC33.