You are on page 1of 51

knowledge

is
power

By: Mahmoud ELHejazi


2020 1
Objectives

 The OSI Model

 The TCP/IP Model

 PDU (Protocol Data Unit)

 Wireshark

2
What Is The OSI Model?

 Open systems interconnection reference model

 Defined by International Organization for Standardization (ISO)

 A standardized architecture defining network communication

 There are unique protocols at every layer

 Useful tool for network troubleshooting

3
Why We Need It?

 Each vendor had its own proprietary solution

 One vendor’s solution was not compatible with another vendor’s


solution

 This is where the idea for the OSI-model was born

4
The OSI Model
Layer 7
Application  Upper Layers
Layer 6 • Focus on servicing the application
Layers
Upper

Presentation

Layer 5
 Lower Layers
Session • Focus on end-to-end data delivery
• This our concern
Layer 4
Transport

Layer 3
Network

Layer 2
Data Link

Layer 1
Physical
5
Application Layer
Layer 7
Application  What we see
Layer 6
Presentation  Make the network services available to the end
host’s applications “shared printer, web server, mail
Layer 5 server, and etc.”
Session • Email, Telnet, Web, etc
Layer 4
Transport  HTTP, FTP, DNS, POP3, and etc

Layer 3
Network

Layer 2
Data Link

Layer 1
Physical
6
Presentation Layer
Layer 7
Application
 Ensures that data can be understood between two
Layer 6
end hosts
Presentation
• ASCII character encoding
Layer 5
Session  Application encryption
Layer 4
 Often combined with the application layer
Transport

Layer 3
Network

Layer 2
Data Link

Layer 1
Physical
7
Session Layer
Layer 7
Application
 Communication management “manages sessions
Layer 6
Presentation
between end hosts”
• Start, stop, restart
Layer 5 • E.g. Web server tracking its open connects to web
Session browser client

Layer 4  Tracking the services by port numbers


Transport • Keeps sessions separate
Layer 3
Network

Layer 2
Data Link

Layer 1
Physical
8
Transport Layer
Layer 7
Application  Breaks up data between sender and receiver into
smaller parts Called “Segmentation”
Layer 6
Presentation  Establishes End-to-End Connectivity
Layer 5
Session  Can Ensures Reliable Delivery
• I.e. error detection and recovery “retransmission”
Layer 4
Transport  Layer 4 Protocols
Layer 3 • Transmission Control Protocol (TCP)
Network • User Datagram Protocol (UDP)

Layer 2
Data Link

Layer 1
Physical
9
Network Layer
Layer 7
Application
 End-to-End Delivery
Layer 6
Presentation  Internet protocol (IP) address
• Logical address
Layer 5 • Every network device needs a unique address on the
Session network
• IPv4 and IPv6 Addresses
Layer 4
Transport
 The routing layer
Layer 3 • Path selection (routing)
Network
 Packets
Layer 2
Data Link

Layer 1
Physical
10
Data Link Layer
Layer 7  Hop-to-Hop Delivery
Application

Layer 6  Defines data format for transmission


Presentation • E.g. Ethernet, Frame Relay, PPP

Layer 5  Control access to physical media


Session • E.g. Ethernet CSMA/CD
Layer 4
Transport  Defines Physical Address
• E.g. Ethernet MAC address
Layer 3
Network  Error Detection
• E.g. Cyclical Redundancy Check (CRC)
Layer 2
Data Link

Layer 1
Physical
11
Physical Layer
Layer 7
Application
 The physics of the network
Layer 6 • Signaling “morse code”, bits rate, voltage levels
Presentation • Cabling, connectors
• Cable length, cable type
Layer 5 • This layer isn’t about protocols
Session

Layer 4
 If we have a physical layer problem
• Fix your cabling, punch-down, etc
Transport
• Swap adapter cards
Layer 3
Network  Interface Types
Layer 2
 Bits “0 or 1”
Data Link

Layer 1
Physical
12
OSI Mnemonics
Layer 7
Application  All  Away

Layer 6
Presentation  People  Pizza

Layer 5
Session  Seem  Sausage

Layer 4
Transport  To  Throw
Layer 3
Network  Need  Not

Layer 2
Data Link  Data  Do

Layer 1
Physical  Processing  Please
13
PDU (Protocol Data Unit)
Layer 7
Application Encapsulation Data Decapsulation

Layer 6
Presentation Data

Layer 5
Session Data

Layer 4
Transport Data Data Data Segment
Layer 3
Network IP header Segment Packet

Layer 2
Data Link Data link
Packet Trailer Frame
header
Layer 1
Physical 0000111011110001001111 Bits
14
The TCP/IP Protocol Suite
Layer 7
Application

Layer 6 Application  Commonly called the Internet Protocol suite


Presentation Layer
 Similar to the OSI model
Layer 5
Session • But simpler and more compatible with
TCP/IP
Layer 4 Transport
Transport Layer  Easier to correlate the model to the real-
world
Layer 3 Internet
Network Layer

Layer 2
Data Link Network
Access
Layer 1 Layer
Physical
15
OSI Model Layers in Action

Layer - 7 Application Advice


User Support Layers
Layer - 6 Presentation Person
or
Software Layer
Layer - 5 Session Sales

Layer - 4 Transport Core Layer of OSI


Take

Layer - 3 Network Not


Network Support
Layer - 2 Data Link Do Layers
or
Layer - 1 Physical Please
Hardware Layers

16
Application Layer

Application Layer is responsible


Application
Application for providing Networking
Services to user. It also known
Presentation as Desktop Layer.

Session
Ports are nothing but Socket i.e.
Entry and Exit Point to the Layer
Transport

Network Total No. Ports 0 – 65535


Reserved Ports 0 – 1023
Data Link Open Ports 1024 – 65535

Physical

17
Example of HTTP request
http://www.jobkey.ws

Client Web Server


18
Example of HTTP request

HTTP Request
Received HTTP Reply
HTTP Request Listen on
http://www.jobkey.ws
http:// www.jobkey.ws Port 80
Webpage Sending HTTP Reply
Webpage

Client Web Server


19
Example of FTP request
ftp://ftp.microsoft.com

Client FTP Server


20
Example of FTP request

FTP Request
FTP Request
Received FTP Reply Listen on
ftp://ftp.microsoft.com
ftp://ftp.microsoft.com Port 21
Sending FTP Reply

Client FTP Server


21
Examples of Networking Services

Service Port No.

HTTP 80

FTP 21

SMTP 25

TELNET 23

TFTP 69

22
How data flows from Application Layer

Application Data

80 21 25 53 67 69

Presentation

Session

Transport

Network

Data Link

Physical

23
Presentation Layer

Presentation Layer is
Application responsible for converting data
into standard format.
Presentation
Presentation

Examples : ASCII, EBCDIC, JPEG,


Session
MPEG, BMP, MIDI, WAV, MP3
Transport
Following tasks are perform at
Network Presentation layer :

Data Link Encoding – Decoding


Encryption – Decryption
Physical Compression – Decompression

24
How data flows from Presentation Layer

Application Data

Presentation Data

Session

Transport

Network

Data Link

Physical

25
Session Layer

Session Layer is responsible


Application establishing, maintaining and
terminating session.
Presentation
Session ID also works at Session
Layer.
Session
Session

Transport Examples :

Network RPC  Remote Procedure Call


SQL  Structured Query language
Data Link NFS  Network File System

Physical

26
How data flows from Session Layer

Application Data

Presentation Data

Session Data

Transport

Network

Data Link

Physical

27
Transport Layer

Transport Layer is
Application responsible for end-to-end
connectivity. It is also known as
Presentation heart of OSI Layers. Following
task are performed at Transport
Session Layer : -

Transport
Transport • Identifying Service

Network • Multiplexing & De-multiplexing


• Segmentation
Data Link
• Sequencing & Reassembling
Physical • Flow Control
• Error Correction

28
Identifying Service

TCP UDP

• Transmission Control • User Datagram


Protocol Protocol

• Connection Oriented • Connection Less

• Acknowledgement • No Acknowledgement

• Reliable • Unreliable

• Slower • Faster

• Port No. 6 • Port No. 17

• e.g. HTTP, FTP, SMTP • e.g. DNS, DHCP, TFTP

29
Multiplexing & De-multiplexing

Application

Presentation

Session

80 21 25 53 67 69

Transport

TCP - 6 UDP - 17

Network

Data Link

Physical
30
Segmentation

Hello! Hello! How are you ?


How are
you ? Hello! How Are You ?

A B

31
Sequencing & Reassembling

you
Hello! You
Hello! HowHow
Hello! are ?
you
Are? Hello!
How are
How ?
you ? You How You
Hello! Hello!
How Are ? Are
?are

A B

32
Sequencing & Reassembling

Hello! Hello! How are you ? Hello!


How are How are
you ? Hello! How Are You ?you ?
1/5 2/5 3/5 4/5 5/5

You Hello! How ? Are


4/5 1/5 2/5 5/5 3/5

A B

33
Error Correction

Segment Missing
Hello! Hello! How are you ? Hello!
How are How are
you ? Hello! How Are You ?you ?
1/5 2/5 3/5 4/5 5/5

You Hello! How ? Are


4/5 1/5 2/5 5/5 3/5

A B

34
Flow Control - Windowing

Ack-Rec- PC-A
Ack.
Sending Received
3
Received- can send 4 Segment
3-window
Sending 3-window
4-window
4
5-window at a time to
PC-B

A B

35
How data flows from Transport Layer

Application Data

Presentation Data

Session Data

Transport TH Data
Segment

Network

Data Link

Physical

36
Network Layer

Network Layer is
Application responsible for providing best
path to data to reach destination.
Presentation Logical Addressing sits on this
layer. Device working on Network
Session Layer is Router.

Transport It is divided into two parts


• Routed Protocols
Network
Network
e.g. IP, IPX, Apple Talk.
Data Link • Routing Protocols

Physical e.g. RIP, IGRP, OSPF, EIGRP

37
Routed Protocols

Segment

Hello! Hello!
How are How are
you ? Source IP
192.168.1.1
you ?
Destination
Segment IP
192.168.1.2

A B

192.168.1.1 192.168.1.2
38
Routing Protocols

www.jobkey.com

39
How data flows from Network Layer

Application Data

Presentation Data

Session Data

e.g. Router Transport Segment

Network Packet
NH Segment

Data Link

Physical

40
Datalink Layer

Datalink Layer is
Application divided into two Sub Layers :

Presentation
• LLC – Logical Link Control
Session It talks about Wan protocols e.g.
PPP, HDLC, Frame-relay
Transport
• MAC – Media Access Control
Network It talks about Physical Address.
It is 48 bit Addressing
Data
Data Link
Link i.e. 12 digit Hexadecimal No.
It is also responsible for Error
Physical Detection
Device working on Data Link
Layer is Switch, Bridge, NIC.
41
Error Detection – CRC Check

PC-A
Packet

Hello!
CRC No. 33333
How arePC-B
you ? Source MAC
CRC No. 11114
00-20-18-C0-07-71
Error00000
33333
11114
46323
99434
43434
99323
55434
89696
22222
32434
Detected
Error 00-20-18-C0-07-72
Detected
Destination
Packet MAC

For Error Correction


Contact Source Transport layer
A B

192.168.1.1 192.168.1.2
00-20-18-C0-07-71 00-20-18-C0-07-72
42
Error Detection – CRC Check

Packet

Hello!
How are
Source MAC
00-20-18-C0-07-71
you ?
20202
11114
46323
99434
43434
99323
55434
89696
22222
32434
00000
Destination
Packet MAC
00-20-18-C0-07-72

A B

192.168.1.1 192.168.1.2
00-20-18-C0-07-71 00-20-18-C0-07-72
43
How data flows from Data Link Layer

Application Data

Presentation Data

Session Data

Transport Segment

e.g. Switch Network Packet

Data Link Frame


DH PacketDT

Physical

44
Physical Layer

Physical Layer is
Application responsible for electrical,
mechanical or procedural checks.
Presentation Data will be converted in Binary
that is 0’s & 1’s. Data will be in the
Session form of electrical pulses if it is
Coaxial or Twisted Pair cable and in
Transport the form of Light if it is Fiber Optic
Cable.
Network
Devices working at Physical Layer
Data Link are Hubs, Repeaters, Cables,
Modems etc.
Physical
Physical

45
Physical Layer Example

Frame

Hello!
How are
you ?
1010101010101010
Frame

A 0101011010101010101010101
1010101101010101010101010
0101011010101010101010101 B

46
How data flows from Physical Layer

Application Data

Presentation Data

Session Data

Transport Segment

Network Packet

e.g. Hub Data Link Frame

Physical Bits

47
Data Encapsulation & De-capsulation

A B

Application Data Data Application

Presentation Data Data Presentation

Session Data Data Session

Transport TH Data
Segment TH Data
Segment Transport TH

Network NH Segment
Packet NH Segment Network NH
Packet

Data Link DH Packet


Frame DT Frame DH
DT Packet
Packet Data LinkDH
DT

Physical Bits Bits Physical

48
Comparing OSI with TCP/IP Layers

OSI Layers TCP/IP Layers

Application

Presentation Application

Session

Transport Transport

Network Internet

Data Link
Network
Access
Physical
49
The Layers in Wireshark

50
Thank you For your Attention
Any Questions ?

51

You might also like