0% found this document useful (0 votes)
7 views

Computer - Networks - CS301 Notes

My notes of the first part of computer networks

Uploaded by

Renish
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Computer - Networks - CS301 Notes

My notes of the first part of computer networks

Uploaded by

Renish
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Notes

The Internet is a global network of computers that are connected to each other. It allows people to share
information and communicate over long distances.

Computer Networks
A group of interconnected device that share resources and communicate with each other.

Nodes
Devices connected to a network which are capable of sending/receiving data generated by other
devices/nodes in the network.

End Nodes

Devices like computers or smartphones that send or receive data.

Ex: Laptops, PCs, smartphone, etc.

Intermediary Nodes

Devices like routers or switches that help route data between end nodes.

Ex: Router, Switch, Firewall, Cellphone Tower, Repeaters, etc.

Communication Links
Physical or wireless connections that carry data between nodes.

Wired Links

Physical cables like Ethernet that connect devices.

Ex: Ethernet, coaxial, fiber-optic cable.

Wireless Links

Radio waves or other wireless methods used to connect devices.

Ex: Wi-Fi link, 4G, 5G, etc.

Characteristics of CN
Fault Tolerant

Ability to continue functioning even when a component fails.

Ensures reliability and minimizes downtime.

Scalability

Capacity to grow and accommodate more devices or increased traffic.

Allows for expansion without major disruptions.

Quality of Service (QoS)

Mechanisms to manage network resources to ensure performance.

Prioritizes critical applications and minimizes latency and jitter.

Notes 1
Security

Protection of data and resources against unauthorized access and threats.

Involves measures like encryption, firewalls, and access controls.

Important Terms in CN
Hosts/End Users - Devices that interact with the network, generating and receiving data.

Ex: Computers, smartphones, printers, etc.

Communication Links (Wired or Wireless) - Channels that connect devices in a network.

Ex: Ethernet cables, Wi-Fi, fiber optics.

Routers - Devices that forward data packets between networks, directing traffic efficiently.

Ex: Home router connecting multiple devices to the internet.

Switches - Devices that connect multiple devices on a local network, forwarding data only to the intended
recipient.

Ex: Network switch in an office environment.

Hub - A basic device that connects multiple Ethernet devices, broadcasting data to all connected devices.

Ex: USB hub for multiple devices.

Servers - Powerful computers that provide data or services to other computers (clients) over the network.

Ex: Web server, file server.

Client - Devices that access services provided by servers in the network.

Ex: Web browsers, email clients.

Routers - Forward data packets between networks and manage traffic.

Switches - Connect devices within a local network and direct data to specific destinations.

Hub - Connects multiple devices and sends incoming data packets to all connected devices.

Packet Switches

Devices like that forward data packets between nodes to their destination.

Ex: Routers & Switches.

Packed Data Units (PDUs) - A structured unit of data that is transmitted over a network.

Bits & Bytes

Packet - A formatted unit of data carried by a packet-switched network, containing both header and
payload.

Frame - A data packet at the data link layer, encapsulating packets with additional header and trailer
information.

Segment - A unit of data at the transport layer, representing a portion of the data stream, often
associated with TCP.

Datagram - A basic transfer unit associated with the network layer, often used in connectionless
communication protocols like UDP.

Notes 2
Packet Switching vs Circuit Switching
1. Packet Switching - Data is broken into packets and each packet is sent independently through the
network. These packets may take different paths to the destination and are reassembled at the
destination.

Ex: Internet, Ethernet cable.

Key Characteristics:

Dynamic routing: Each packet can take different routes.

Resource sharing: Bandwidth is shared among multiple users.

Efficiency: Better bandwidth utilization as resources are used only when data is transmitted.

Delay: May experience variable delays (due to congestion and rerouting).

Connection type: No dedicated path; connectionless communication.

2. Circuit Switching - A dedicated communication path or circuit is established between the sender and
receiver for the duration of the communication session.

Ex: Landline telephone calls, ISDN.

Key Characteristics:

Fixed routing: A dedicated path is established and reserved for the entire communication session.

Exclusive use: The path remains reserved for the connection, even if no data is being transmitted.

Predictable delay: Fixed and consistent delays as the path is reserved.

Connection type: Dedicated, connection-oriented communication.

Feature Packet Switching Circuit Switching

Connection Type Connectionless Connection-oriented

Path Dynamic, packets may take different routes Fixed, dedicated path for the entire session

Efficiency High (resources shared) Low (resources reserved but underutilized)

Delay Variable (depends on network conditions) Fixed and predictable

Usage Internet, Email, FTP, Video Streaming Traditional telephone systems

Reliability Ensured by protocols (e.g., TCP) Reliable due to a dedicated path

Flow of Data in Communication


Simplex

One-way communication where data flows in a single direction.

Ex: Keyboard, Printers, etc.

Half-Duplex

Two-way communication where data can flow in both directions, but not simultaneously.

Ex: Walkie-Talkies.

Duplex

Two-way communication where data can flow in both directions simultaneously.

Notes 3
Ex: Telecommunication.

Types of Network
1. Peer-to-Peer Network - A decentralized network where each device (peer) can act as both a client and a
server, allowing direct sharing of resources.

No central server; all devices are equal.

Each peer can share files, printers, and other resources directly.

Easy to set up and maintain, flexible and scalable for small networks, less/no dependency on a central
server.

Limited security and control, difficult to manage in larger networks as there is less
control/dependency on a central server.

Ex: Home networks, small office networks.

2. Client-Server Network - A centralized network architecture where clients request resources and services
from a dedicated server.

Central server provides resources and manages requests from clients.

Clients are dependent on the server for resources.

Advantages

It has better organization and management and can be easily scaled to large-scale application.

Enhanced security and control over data and resources, easier to manage and maintain with
centralized administration.

Disadvantages

Single point of failure if the server goes down.

Requires more complex setup and administration and its expensive to setup & maintain.

Ex: Web servers, email servers, database servers.

Access Networks
The network that physically connects an end system to the first router
(also known as edge router) on a path from the end system to any other distant end system.

Type Coverage Area Speed Bandwidth Typical Range

Home, office, school, Up to several


LAN High (up to 1000 Mbps) High (fewer devices)
campus kilometers

Moderate (44 to 155 Less than LAN (more 100 to 1000


MAN City or town
Mbps) devices) kilometers

Low (many MANs


WAN Country or continent Low (around 150 Mbps) Broad coverage
connected)

MAC Address
A MAC address is a unique identifier assigned to a device's network interface card (NIC).

It is used to facilitate communication at the Data Link Layer (Layer 2) of the OSI model.

Notes 4
It plays a crucial role in local network communication, ensuring that data packets are delivered to the
correct device within a network.

Format of MAC Address


Length: 48 bits (6 bytes).

Represented as a group of HEXADECIMAL characters, seperated by colons ( : ) or hyphons ( - )

Example: 00:1A:2B:3C:4D:5E , 00-1A-2B-3C-4D-5E .

Structure for 00:1A:2B:3C:4D:5E

OUI (Organizationally Unique Identifier): The first 24 bits (or first 3 bytes) represent the OUI, which is
assigned by the IEEE to the manufacturer.

Example: 00:1A:2B indicates the manufacturer.

NIC-Specific: The last 24 bits (or last 3 bytes) are specific to the device and are assigned by the
manufacturer.

Example: 3C:4D:5E is unique to the device within the manufacturer’s range.

Communication Types of MAC Address


1. Unicast Address - Used to identify a single, specific network device.

The LSB (Least Significant Bit) of the first byte of the MAC address determines whether it is unicast
or multicast:

In unicast addresses, the LSB of the first byte is 0.

This means the first byte's binary value must end with a 0 (even numbers in hexadecimal).

Example:

Hex: 00:1A:2B:3C:4D:5E

Binary (first byte): 00000000 (ends with 0, so it's unicast)

2. Multicast Address - Used to send data to multiple devices, often in a specific group, but not to all devices
on the network.

Bit Explanation: In multicast addresses, the LSB of the first byte is 1.

This means the first byte's binary value must end with a 1 (odd numbers in hexadecimal).

Example:

Hex: 01:00:5E:XX:XX:XX (IPv4 multicast)

Binary (first byte): 00000001 (ends with 1, so it's multicast)

3. Broadcast Address

Purpose: Used to send data to all devices in the same network segment.

Special Format: The MAC address for broadcast communication is always FF:FF:FF:FF:FF:FF .

All bits of this address are set to 1 in binary, indicating it is intended for all devices on the network.

Example:

Hex: FF:FF:FF:FF:FF:FF

Notes 5
Binary: 11111111 11111111 11111111 11111111 11111111 11111111

Type First Byte LSB Address Example Purpose

Unicast Address 0 (even number) 00:1A:2B:3C:4D:5E Targets a single network device.

Multicast Address 1 (odd number) 01:00:5E:XX:XX:XX Targets a group of network devices.

Broadcast Address N/A (all bits 1) FF:FF:FF:FF:FF:FF Sends data to all devices in the network.

MAC Address in Network Communication


Frame Transmission: When a device sends data over a LAN, it encapsulates the data in a frame that
includes the source and destination MAC addresses.

Switching: Switches, which operate at Layer 2, use MAC addresses to make forwarding decisions. They
maintain a MAC address table that maps each MAC address to the corresponding physical port.

Address Resolution Protocol (ARP): When a device wants to communicate with another device, it may
know the IP address but not the MAC address. The ARP protocol is used to map an IP address to a MAC
address by sending an ARP request.

Types of MAC address

Static MAC Address: This is the permanent, factory-assigned address programmed into the NIC. It is
globally unique and used for identification on a network.

Dynamic MAC Address: Sometimes a device can alter its MAC address through MAC address
spoofing. This is typically done for privacy purposes or to bypass MAC address filters in certain
networks.

MAC Addresses in Network Security


MAC Filtering: Network administrators can configure routers and switches to allow or deny traffic based
on MAC addresses. This adds an extra layer of security, although it's not foolproof (due to spoofing).

Device Tracking: MAC addresses can be used to track devices on a network. Because MAC addresses
are unique to each device, they can serve as an identifier for monitoring network activity.

MAC Address Spoofing - The practice of altering the MAC address on a network interface to assume the
identity of another device. This is often done to bypass MAC-based access control measures.

Content Addressable Memory (CAM)


Switch Functionality: Switches store a table of MAC addresses and their associated ports, known as a
Content Addressable Memory (CAM) Table or MAC address table.

Learning Process: When a switch receives a frame, it learns the source MAC address and the port it
arrived on, updating the table.

When it needs to forward a frame, the switch looks up the destination MAC in this table to determine
which port to send the frame to.

Aging: Entries in the MAC address table are typically temporary, with an aging timer that removes inactive
entries after a certain period.

IP Address

Notes 6
An IP address is a unique numerical identifier assigned to each device connected to a network that uses
the Internet Protocol (IP) for communication.

It operates at the Network Layer (Layer 3) of the OSI model and is essential for routing data packets
between different networks.

Format of IP Address
1. IPv4 Address

Length: 32 bits (4 bytes).

Represented as a group of four decimal numbers, separated by periods (dots).

Structure

Network Address - Identifies the network to which the device belongs.

Host Address - Identifies the specific device (host) within that network.

2. IPv6 Address

Length: 128 bits (16 bytes).

Represented as a group of eight blocks of four hexadecimal characters, separated by colons.

Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 .

Structure: Divided into two parts:

Prefix: Identifies the network or subnet.

Interface Identifier: Identifies the specific interface (host) within the network.

Shortening: Continuous blocks of zeros can be compressed using double colons ( :: ).

Example: 2001:0db8::8a2e:0370:7334 .

Private vs Public IP Addresses


1. Private IP Address

Purpose: Used within private networks; not routable on the Internet.

IPv4 Examples:

10.0.0.0 to 10.255.255.255

172.16.0.0 to 172.31.255.255

192.168.0.0 to 192.168.255.255

IPv6 Example: fc00::/7 (Unique Local Address)

2. Public IP Address

Purpose: Globally unique, routable on the Internet, and assigned by the Internet Service Provider
(ISP).

IPv4 Example: 8.8.8.8 (Google's DNS Server)

IPv6 Example: 2001:4860:4860::8888 (Google's DNS Server)

Dynamic vs Static IP Address

Notes 7
1. Dynamic IP Address

Assigned by DHCP (Dynamic Host Configuration Protocol) server.

Automatically assigned, typically used for temporary connections.

2. Static IP Address

Assigned manually by a network administrator.

Permanent, often used for servers, printers, and devices requiring consistent addressing.

Class B: 128.0.0.0 to 191.255.255.255 (used for medium networks)

IP Address Classes (IPv4)


Class A: 1.0.0.0 to 126.255.255.255 (used for large networks)

Class C: 192.0.0.0 to 223.255.255.255 (used for small networks)

Class D: 224.0.0.0 to 239.255.255.255 (reserved for multicast)

Class E: 240.0.0.0 to 255.255.255.255 (reserved for future use)

IP Address Communication Types


1. Unicast IP Address

A unicast IP address is assigned to a single device, and data sent to this address is intended for that
specific device only.

Unicast communication is the most common type of IP communication on networks.

Usage:

Used for one-to-one communication, where a source sends data directly to a single destination.

Address Range:

IPv4: Most IP addresses in IPv4 are unicast (e.g., 192.168.1.10 , 10.0.0.1 ).

IPv6: Similar rules apply to IPv6 (e.g., 2001:0db8:85a3::8a2e:0370:7334 ).

Example:

A user sending an email to another user, where the email is routed directly to the intended
recipient's device.

IPv4: 192.168.1.1 , IPv6: 2001:db8::1

2. Multicast IP Address
A multicast IP address is used to send data to a group of devices that are interested in receiving the
information.

Data is sent to a specific group of devices without sending it to all devices on the network, which saves
bandwidth.

Usage

Common in one-to-many communication, especially in streaming video, real-time data updates, and
conferencing.

Only the devices that are part of the multicast group will process the data.

Notes 8
Address Range:

IPv4: The range 224.0.0.0 to 239.255.255.255 is reserved for multicast addresses.

IPv6: Multicast addresses start with ff00::/8 .

Example:

Streaming a live event to multiple viewers where the data is transmitted only to users subscribed to
that multicast group.

IPv4: 224.0.0.5 (used by OSPF)

IPv6: ff02::1 (multicast to all nodes on the local network)

3. Broadcast IP Address
A broadcast IP address is used to send data to all devices within the same network segment or broadcast
domain.

It is used in scenarios where information needs to be shared with every device in a local network.

It is not used in IPv6 networks, instead multicast is preferred.

Usage - One-to-all communication where a message is sent to every device in the same local network.

Address Range:

IPv4: 255.255.255.255 is the broadcast address for all devices in a local network. In subnets, a more
specific broadcast address is used (e.g., 192.168.1.255 for the 192.168.1.0/24 subnet).

Example:

DHCP uses broadcast to discover and assign IP addresses to new devices joining a network.

IPv4 Limited Brodcast - 255.255.255.255 (broadcast to all devices, not forwarded by router).

IPv4 Directed Brodcast - 192.168.1.255 (broadcast within a specific subnet)

Protocol
A set of rules and conventions for communication between network devices.

Ensures data is transmitted accurately and efficiently across the network.

A protocol defines the format and the order of message exchanged between two or more communicating
entities, as well as the action taken on the transmission or reception of a message or other event

Ex: TCP/IP, HTTP/HTTPS, FTP, etc.

Elements of Protocol
Message Encoding - The process of converting data into a specific format for transmission.

Message Formatting and Encapsulation - Structuring the message and enclosing it with necessary
headers and trailers for proper interpretation.

Message Timing - The control of the timing of message transmission to ensure synchronization between
sender and receiver.

Message Size - Specifies the maximum size of a message to be transmitted over the network.

Message Delivery Option - Different methods for delivering messages:

Notes 9
Unicast - One-to-one communication

Multicast - A one-to-many communication.

Broadcast - A one-to-all communication.

OSI - Open Systems Interconnection Protocol


1. Application Layer - Provides network services directly to user applications. It enables users to access
network resources and serves as a window for application services to access the network and display
received information to the user. It is also called the desktop layer.

Functions: Mail services, directory services, file transfer and access management.

Protocols: HTTP, SMTP, FTP, TFTP, DNS, DHCP.

Devices/Tools:

Web Browsers: Chrome, Firefox

Email Clients: Outlook, Thunderbird

File Transfer Clients: FileZilla

DNS & Application Servers

Message Unit: Normal Message

2. Presentation Layer - Translates data between the application layer and the network. It handles data
formatting, encryption, and compression, making it the translation layer.

Functions: Translation (converting data into a common format), encryption (security purpose),
compression (compressing long-duration videos and high-resolution images).

Protocols: TLS/SSL, JPEG, GIF, MPEG, ASCII.

Devices/Tools: Gateways, Load Balancers, Proxy Servers.

Message Unit: Formatted Data

3. Session Layer - Establishes, manages, and terminates sessions between applications. It is responsible for
authentication, security, dialog control, and synchronization.

Functions: Dialog control, synchronization, session establishment, maintenance, and termination.

Protocols: RPC (Remote Procedure Call), NetBIOS, PPTP, SAP (Session Announcement Protocol).

Devices/Tools: Session Controllers, Middleware Solutions.

Message Unit: Session Data

4. Transport Layer - Provides reliable data transfer and error recovery. It ensures complete data transfer,
manages flow control, and adds source and destination port numbers to the segmented data.

Functions: Port addressing, segmentation and reassembly, connection control, end-to-end flow
control, error control.

Protocols: TCP (connection-oriented, used for reliable data transmission), UDP (connectionless, used
for real-time traffic).

Devices/Tools: Firewalls, Load Balancers, Routers (with transport layer functions).

Message Unit: Segment (TCP) / Datagram (UDP)

Notes 10
5. Network Layer - Responsible for routing and forwarding data packets between different networks. It
delivers data from the original source to the destination using IP addresses and takes care of packet
routing.

Functions: Logical addressing, routing.

Protocols: IPv4, IPv6, ICMP, ARP, BGP.

Devices/Tools: Routers, Layer 3 Switches, Gateways.

Message Unit: Packet

6. Data Link Layer - Provides node-to-node data transfer and error detection. It frames data packets for
transmission and is divided into Logical Link Control (LLC) and Media Access Control (MAC).

Functions: Framing, physical addressing, flow control, error control, access control.

Protocols: Ethernet, PPP, Frame Relay, HDLC, 802.11 (Wi-Fi), MAC address.

Devices/Tools: Switches, Network Interface Cards (NICs), Bridges, Hubs.

Message Unit: Frame

7. Physical Layer - Deals with the physical transmission of data over network media. It includes the
transmission of raw bitstreams and provides electrical and mechanical specifications.

Functions: Physical characteristics of the medium (wired or wireless), synchronization of bits, bit rate
control, physical topologies (star, bus, or mesh connection), transmission mode (duplex, half-duplex,
full-duplex).

Protocols: IEEE 802.3 (Ethernet), IEEE 802.11 (Wi-Fi), Bluetooth, USB.

Devices/Tools: Cables (e.g., Fiber Optic, Coaxial, Twisted Pair), Connectors (e.g., RJ-45, SC, LC),
Repeaters, Modems.

Message Unit: Bits/Raw Data.

TCP/IP Protocol
1. Application Layer - Provides protocols for specific data communication services. It enables users to
access network resources and facilitates communication between applications over the network.

Functions: Mail services, file transfer, application services.

Protocols: HTTP, SMTP, FTP, DHCP, SNMP.

Devices/Tools: Web Servers, Email Servers, Application Servers.

Message Unit: Classic Message

2. Transport Layer - Manages end-to-end communication and data delivery. It ensures that data is sent and
received correctly while providing reliable or unreliable delivery.

Functions: Segmentation and reassembly, flow control, error detection and correction.

Protocols: TCP, UDP, SCTP.

Devices/Tools: Firewalls, Load Balancers.

Message Unit: Segment (TCP) / Datagram (UDP)

Notes 11
3. Network/Internet Layer - Responsible for logical addressing and routing of data packets across
networks. It manages packet forwarding and routing through intermediate routers.

Functions: Logical addressing, packet routing, and forwarding.

Protocols: IPv4, IPv6, ICMP, ARP.

Devices/Tools: Routers, Gateways.

Message Unit: Packet

4. Data Link Layer - Manages node-to-node data transfer and facilitates communication within local
networks. It ensures error-free data transmission and regulates access to the physical medium.

Functions: Framing, physical addressing, error detection, and flow control.

Protocols: Ethernet, PPP, HDLC, MAC address.

Devices/Tools: Switches, Network Interface Cards (NICs), Bridges.

Message Unit: Frame

Sender message goes from TOPto-BOTTOM.

Receiver message goes from BOTTOMto-TOP.

Nodal Delay & Packet Loss


It refers to the total time taken for a packet to pass through a router or switch in a network. It comprises
various components that contribute to the overall delay experienced by the packet during its journey through
the network.
$$
d_{\text{nodal}} = d_{\text{proc}} + d_{\text{queue}} + d_{\text{trans}} + d_{\text{prop}}
$$

Notes 12
Processing Delay (𝑑𝑝𝑟𝑜𝑐)
The time taken by a router or switch to process the packet header and determine where to forward the
packet.

High-speed routers usually experience processing delays on the order of microseconds or less.

Queueing Delay (𝑑𝑞𝑢𝑒𝑢𝑒)


The time a packet spends waiting in a queue at a router's output link before it can be transmitted.

The level of congestion at the router affects the queue length, thereby influencing the waiting time.

Packets are transmitted in a first-come-first-serve manner.

$$
\text{Traffic Intensity (TI)} = \frac{Length\;of\;Packet\;(in\; bits)\;\times
\;Av.\;Rate\;of\;Packet\;Arrival\;(in \;packets/sec)}{Transmission\;Rate\;(bits/sec)}
$$

If TI > 1, Arrival Rate is greater than transmission rate.

If TI < 1, Arrival Rate is lesser than transmission rate.

Transmission Delay (𝑑𝑡𝑟𝑎𝑛𝑠)


The amount of time required to push all bits of a packet onto the link.

Typical Duration: Ranges from milliseconds to microseconds.


$$
d_{trans} = \frac{L}{R}
$$

L - length of the packet in bits

R - transmission rate of the link in bits/sec

Propagation Delay (𝑑𝑝𝑟𝑜𝑝)


Definition: The time taken for a signal to travel from the sender to the receiver over a physical medium.

$$
d_{prop} = \frac{d}{s}
$$

d - distance between the two routers (physical length)

s - propagation speed of the link

Delay Type Description Typical Duration

Processing Delay Time to process packet header and forwarding decision Microseconds

Queueing Delay Time waiting in queue before transmission Varies (depends on congestion)

Transmission Delay Time to push all bits of the packet onto the link Milliseconds to Microseconds

Propagation Delay Time for signal to travel to the next router Depends on distance and medium

Packet Loss

Notes 13
Packet loss refers to the failure of one or more transmitted packets to reach their destination. It is a
common issue in computer networks, particularly in those that rely on packet-switching technologies.

Nodal Queue (buffer) has finite capacity.

If the queue is full, then any new packet arriving at the router will be lost or dropped.

Lost packet may be retransmitted.

The fraction of lost packet increasing as the traffic intensity increases.

Packet Loss Percentage

$$
\text{Packet Loss (\%)} = \left( \frac{\text{Number of Lost Packets}}{\text{Total Packets Sent}} \right) \times
100
$$

Data-Link Layer

Notes 14

You might also like