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:
Switches
For e.g. Catalyst , Catalyst .
- 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 +).
- 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 , ISR or ISR .
- 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. ASA-X, Firepower .
- 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- as an interface. It is -pin modular connector with positions and contacts (PC). Below table shows pins on which each device receives and transmits the data:
Device | Transmit Pins | Recieve Pins |
---|---|---|
Router | and | and |
Firewall | and | and |
PC | and | and |
Switch | and | and |
Copper cables using ethernet standard are called Unshielded Twisted Pair (UTP) cables. It has pairs of cables twisted together, which makes wires in total. Ethernet and Fast Ethernet uses pairs or wires. Gigabit Ethernet and Gig Ethernet uses all pairs of UTP cables.
Below are ethernet standards for copper cables:
Speed | Common Name | IEEE Standard | Informal Name | Maximum Length |
---|---|---|---|---|
Mbps | Ethernet | i | BASE-T | m |
Mbps | Fast Ethernet | u | BASE-T | m |
Gbps | Gigabit Ethernet | ab | BASE-T | m |
Gbps | Gig Ethernet | an | GBASE-T | m |
byte = 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:
Speed | IEEE Standard | Informal Name | Maximum Length | Cable Type |
---|---|---|---|---|
Gbps | z | BASE-LX | m - km | Multimode Or Single Mode |
Gbps | ae | GBASE-SR | m | Multimode |
Gbps | ae | GBASE-LR | km | Single Mode |
Gbps | ae | GBASE-ER | km | Single 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 layers. Application developer works with the top layers of OSI model and Network Engineer works with last layers of OSI model.
Below are layers of OSI model:
Application:
- Application layer is closest to end user and intereacts with software applications.
- HTTP & HTTPS are layer 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 header, which includes information like source and destionation IP address to the segment.
- Combination of Data, layer header, and layer header is called packet.
- Routers operates at layer .
Data Link
- 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 layer also uses addressing.
- Layer adds layer header and layer trailer to packet and it is called frame.
- Switches operates at layer .
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 .
TCP/IP Suite
Conceptual model and set of communications protocols used in the internet and other networks. There are only layers in TCP/IP protocol.
The diagram below illustrates the comparison between the OSI model and the TCP/IP model:
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 -byte (-bit) physical address assigned to device when it is made.
- It is also know as Burned-In-Address.
- It is globally unique.
- The first bytes are the OUI(organizationally Unique Identifier), which is assigned to the company making the device.
- The last bytes are unique to the device itself.
Ethernet LAN Switching
Let's say we have ethernet setup as shown in below diagram:
Now, suppose PC wants to send data to PC. 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 PC does not know PC's MAC address. However, since switches are layer devices that operate using MAC addresses, PC must first learn PC's MAC address.
ARP Process
To learn the MAC address, PC uses the Address Resolution Protocol (ARP). It sends an ARP request, and PC 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 PC.
Steps:
-
PC sends an ARP request on its interface (G0/1), which is received by Switch .
-
Upon receiving the ARP request, Switch adds PC'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 forwards the ARP request to all its network interfaces except the one on which it was received.
-
PC receives the ARP request but discards it since the destination IP does not match its own.
-
Switch receives the ARP request and adds PC's MAC address to its MAC address table.
-
Since the destination MAC address is a broadcast, Switch also forwards the ARP request to all its network interfaces except the one it came from.
-
PC discards the frame for the same reason as PC.
-
PC 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 receives the ARP reply, updates its MAC address table with PC's MAC address, and forwards the reply to Switch .
-
Switch forwards the ARP reply to PC since it knows that PC's MAC address is associated with the G0/1 interface.
-
PC receives the ARP reply and stores an entry for PC in its ARP table, associating PC's IP address with its MAC address.
PC can now use this information to send data directly to PC.