Computer Networking
By Supun Asanga
Introduction OSI
• The Open System Interconnection Reference Model (OSI Reference Model
or OSI Model) is an abstract description for layered communications and
computer network protocol design.
• In 1978, the International Standard Organization (ISO) began to develop its
OSI framework architecture.
2
OSI Model
Data unit Layer Function
[Link] Network process to application
Data representation, encryption and
Data 6. Presentation
Host decryption
layers 5. Session Interhost communication
End-to-end connections and reliability,
Segments [Link]
Flow control
Path determination and logical
Packet 3. Network
addressing
Media
Frame 2. Data Link Physical addressing
layers
Bit 1. Physical Media, signal and binary transmission
Going from layer 1 to 7: Please Do Not Throw Sausage Pizza Away
Going from layer 7 to 1: All People Seem To Need Data Processing
3
Application Layer
• Provides network services to application processes. Services
include the following:
Session Layer
• 1. Session Establishment, Maintenance, and Termination
The layer handles the lifecycle of a connection. It sets up the
communication environment, keeps it alive during the exchange, and
ensures a graceful "handshake" to close the connection once the task is
finished.
• 2. Dialogue Control
The Session Layer determines how the communication flows:
• Simplex: One-way communication.
• Half-Duplex: Two-way communication, but only one side talks at a
time (like a walkie-talkie).
• Full-Duplex: Both sides can talk simultaneously.
3. Synchronization (Checkpoints)
• This is perhaps the most critical feature for large data transfers.
The layer inserts checkpoints (sync points) into the data stream.
• Example: If you are downloading a 100MB file and the connection
drops at 55MB, the Session Layer uses the last checkpoint (e.g., at
50MB) to resume the download from that point rather than starting
from zero.
4. Authentication and Authorization
• It manages security by ensuring that only authorized users or
processes can establish a session.
• NetBIOS: Used for communication between computers on a local
network.
•RPC (Remote Procedure Call): Allows a program on one
computer to execute code on another.
•PPTP (Point-to-Point Tunneling Protocol): Used in VPNs to
create secure sessions.
•SQL (Structured Query Language): Manages sessions between a
client and a database server.
Physical Address
A physical address is a unique hardware identifier assigned to a network
interface card (NIC). It is used for communication within the same local
network (LAN).
Key Features
• Also called: MAC Address or Hardware Address
• Assigned by: Device manufacturer
• Works at: Data Link Layer (Layer 2) of the OSI Model
• Length: 48 bits (6 bytes)
• Format: Hexadecimal
• ipconfig/all
Logical Address – IP Address
An IP Address (Internet Protocol Address) is a logical address
used to identify a device on a network and allow it to communicate
with other devices.
Main Purpose
• An IP address is used to:
• Identify a device on a network
• Show where the device is located
• Enable communication between different networks (like the
internet)
Types of IP Addresses
1️⃣ IPv4 (Most Common)
• 32-bit address
• Written in decimal numbers separated by dots
2️⃣ IPv6 (Newer Version)
• 128-bit address
• Written in hexadecimal and separated by colons
Public IP Address
• A public IP address is an address that is accessible over the Internet.
Key Features
• Assigned by: ISP (Internet Service Provider)
• Must be globally unique
• Used for communication between networks over the Internet
• Your router usually has the public IP, not each device inside your home
[Link]
Private IP Address
• A private IP address is used inside a local network (LAN) and
cannot be accessed directly from the Internet.
Key Features
• Assigned by: Router or local DHCP server
• Used for communication within the same network
• Can be reused in different networks (not globally unique)
Ipconfig
Public IP vs Private IP
Feature Public IP Private IP
Internet Accessible Yes No
Unique Worldwide Yes No
Assigned By ISP Router/DHCP
Used For Internet communication Local network communication
DNS
• DNS (Domain Name System) is the system that translates
domain names into IP addresses.
[Link] ➜ [Link]
Purpose of DNS
• Makes the internet easy for humans to use
• Converts domain names → IP addresses
• Allows browsers to find the correct server
How DNS Works (Step-by-Step)
1️⃣ You type a website name in the browser
2️⃣ Your device checks local DNS cache
3️⃣ If not found, request goes to a DNS resolver
4️⃣ Resolver asks:
Root DNS Server
TLD Server- Top-Level Domain server (.com, .org, .lk)
5️⃣ The IP address is returned
6️⃣ Your browser connects to that IP
Path determination is the process used by the network layer
(Layer 3) to decide the best path for data to travel from the
source to the destination across multiple networks.
Routers must decide:
• Which path is shortest
• Which path is fastest
• Which path is least congested
Path Determination Uses Routing Metrics
Metric Meaning
Hop Count Number of routers to pass
Bandwidth Speed of the link
Delay Time taken
Cost Administrative value
Reliability Stability of the link
Load Traffic on the link
Routing Protocols That Perform Path Determination
Protocol Type Metric Used
RIP - Routing Information
Distance Vector Hop count
Protocol
OSPF- Open Shortest Path
Link State Cost (bandwidth)
First
EIGRP- Enhanced Interior
Hybrid Bandwidth + Delay
Gateway Routing Protocol
BGP- Border Gateway
Path Vector Policy-based rules
Protocol
Data Link Layer
•Reliable communication over physical links
•Frames data: breaks data into frames and reassembles them
•Frame boundaries creates & detects start/end of frames
•Error handling: uses acknowledgements and retransmissions
•Flow control: prevents sender from overwhelming receiver
•Communication types: works for point-to-point and broadcast
networks
•Duplex modes: supports simplex, half-duplex, and full-duplex
Physical Layer
• The major functions and services performed by the Physical
Layer are:
• Establishment and termination of a connection to a communication
medium.
• Participation in the process whereby the communication resources
are effectively shared among multiple users. For example, flow
control.
• Modulation, or conversion between the representation of digital
data in user equipment and the corresponding signals transmitted
over a communications channel. These are signals operating over the
physical cabling (such as copper and optical fiber) or over a radio link.
• Modulation is the process of changing a carrier signal in order
to send information (data, voice, video) over a communication
medium.
32
Questions.
1. Briefly explain what is the meaning of administrative distance in
routing protocol?
2. What are the protocols used in physical layer?
3. Briefly explain TCP/IP model.
4. Fill the following table.
Routing Protocol Metric Administrative
Distance
RIP
OSPF
4. Write the shortest compressed format of the following IPv6 addresses.
• [Link]
• [Link]
Thank You………………