dict 301: computer networks engr. md. nazim uddin b.sc. engg., m.sc. eng., ph.d. (on going)...
TRANSCRIPT
DICT 301: Computer Networks
Engr. Md. Nazim UddinB.Sc. Engg., M.Sc. Eng., Ph.D. (on going)
Open Systems Interconnection(OSI) Reference Model
Content
TCP/IP Protocol Model
OSI Reference Model
Data Encapsulation and Decapsulation
Communication over the Network
Binary Number System and Conversion
Hands on
1-3
Protocol Layers (TCP/IP Model)
Network Protocols
Pre-determined rules that govern communications
A group of inter-related protocols that are necessary to perform a communication function is called a protocol suite
Role of Protocols
The format or structure of the message, such as how much data to put into each segment
The process by which intermediary devices share information about the path to the destination
The method to handle error and system messages between intermediary devices
The process to setup and terminate communications or data transfers between hosts
Layered Task
We use the concept of layers in our daily life.
Networks are complex!
Many “pieces/ devices/ parts”:▫ hosts▫ routers▫ links of various media▫ applications▫ protocols▫ hardware, software
1-7
Organization of air travel
a series of steps
ticket (purchase)
baggage (check)
gates (load)
runway takeoff
airplane routing
ticket (complain)
baggage (claim)
gates (unload)
runway landing
airplane routing
airplane routing
ticket (purchase)
baggage (check)
gates (load)
runway (takeoff)
airplane routing
departureairport
arrivalairport
intermediate air-trafficcontrol centers
airplane routing airplane routing
ticket (complain)
baggage (claim
gates (unload)
runway (land)
airplane routing
ticket
baggage
gate
takeoff/landing
airplane routing
Layering of airline functionality
Layers: each layer implements a service▫ via its own internal-layer actions▫ relying on services provided by layer below
Why a layered model?
▫ Easier to teach communication process.
▫ Speeds development, changes in one layer does not affect how the other levels works.
▫ Standardization across manufactures.
▫ Allows different hardware and software to work together.
▫ Reduces complexity
1-10
Internet protocol stack (TCP/IP model)
application: supporting network applications▫ FTP, SMTP, HTTP
transport: host-host data transfer▫ TCP, UDP
network: routing of datagrams from source to destination▫ IP, routing protocols
link: data transfer between neighboring network elements▫ PPP, Ethernet
physical: bits “on the wire”
application
transport
network
link
physical
TCP/IP Reference Model
Application
Transport
Internet
Network Access(Host-to-network)
Layer
HTTP TELNET FTP SMTP SNMP
Protocols
TCP UDP
IP ICMP
ETHERNET PACKET RADIO
1-12
messagesegment
datagram
frame
source
application
transportnetwork
linkphysical
HtHnHl M
HtHn M
Ht M
M
destination
application
transportnetwork
linkphysical
HtHnHl M
HtHn M
Ht M
M
networklink
physical
linkphysical
HtHnHl M
HtHn M
HtHnHl M
HtHn M
HtHnHl M HtHnHl M
router
switch
Encapsulation
Protocols at the application layer
HTTP: browser and web server communication
FTP : file transfer protocol
TELNET: remote login protocol
POP3: Retrieve email POP3 is designed to delete mail on the server as soon as the user has
downloaded it
IMAP (Internet Message Access Protocol ) Retrieve emails, retaining e-mail on the server and for organizing it in folders on the
serve
Protocols at the transport layer
Transmission control protocol (TCP), Connection oriented
Connection established before sending data Reliable
user datagram protocol (UDP) Connectionless
Sending data without establishing connection Fast but unreliable
Protocol at the network layer
IP Path selection , routing and addressing
ICMP (Internet Control Message Protocol ) sends error messages relying on IP
a requested service is not available a host or router could not be reached
Protocols at the link layer
• Ethernet ▫ Uses CSMA/CD
• Token Ring
Data Formats
Application data
dataTCPheader dataTCP
header dataTCPheader
dataTCPheader
IPheader
dataTCPheader
IPheader
Ethernetheader
Ethernettrailer
applicationlayer
transportlayer
networklayer
data linklayer
message
segment
packet
frame
Packet Encapsulation (TCP/IP)
The data is sent down the protocol stack Each layer adds to the data by pretending headers
22Bytes20Bytes20Bytes 4Bytes
64 to 1500 Bytes
Encapsulation
Data usually transferred in blocks Protocol data units (PDUs) Each PDU contains data and control information Some PDUs only control
Three categories of control Address
Of sender and/or receiver Error-detecting code
e.g. frame check sequence Protocol control
Additional information to implement protocol functions Addition of control information to data is encapsulation Data accepted or generated by entity and encapsulated
into PDU Containing data plus control information e.g. TFTP, HDLC, frame relay, ATM, AAL5, LLC, IEEE 802.3, IEEE
802.11 [Advance]
Assists in protocol design▫ protocols that operate at a specific layer have defined
information that they act upon and a defined interface to the layers above and below
Fosters competition▫ products from different vendors can work together
Prevents technology or capabilities changes in one layer from affecting other layer above and below
Provides a common language to describe networking functions and capabilities
Benefits of a Layered Model
[Advance]
OSI Reference Model
2 types of networking models
A protocol model provides a model that closely matches the structure of a particular protocol suite▫ Transmission Control Protocol/Internet Protocol (TCP/IP)
A reference model provides a common reference for maintaining consistency within all types of network protocols and services ▫ it is not intended to be an implementation specification or to
provide a sufficient level of detail to define precisely the services of the network architecture
▫ the primary purpose is to aid in clearer understanding of the functions and processes involved
▫ Open Systems Interconnection (OSI) model
Protocol and Reference Models
The OSI Reference Model
The OSI reference model is the primary model for network communications.
Allows you to view the network functions that occur at each layer.
It is a framework that you can use to understand how information travels throughout a network
7 layers -- each of which illustrates a particular network function.
AP
S T
N D
P
Summary of layers
The TCP/IP model describes the functions that occur at layer of protocols within the TCP/IP suite (Protocol Model)
The OSI model is used for network design, operation specifications and troubleshooting (Reference Model)
TCP/IP and OSI Models
The functions of the Application, Presentation and Session layers of the OSI model are combined into one Application layer in the TCP/IP model
The Data Link and Physical layers of the OSI model combine to make the Network Access layer of the TCP/IP model
The key parallel between the two models occur at layers 3 and 4 of the OSI model– TCP operates at the transport
layer– IP operates at the Internet
layer
Comparing the OSI and TCP/IP Models
Communicating over the Network
Creation of data at the application layer of the originating source end device
Segmentation and encapsulation of data as it passes down the protocol stack in the source end device
Generation of the data onto the media at the network access layer of the stack
Transportation of the data through the internetwork, which consists of media and any intermediary devices
Reception of the data at the network access layer of the destination end device
Decapsulation and reassembly of the data as it passes up the stack in the destination device
Passing this data to the destination application at the application layer of the destination end device
Communication Process
1
2
3
4
5
6
7
Source Destination
Communication Process cont…
Communication with OSI Model
Data
(Port) Segment
(IP) Packet
(MAC) Frame
Device Operation Layer
Devices Operate at Layer
Computer Layer-7 (6,5,4)
Router Layer-3
Switch Layer-2
Hub Layer-1
The virtual interaction between layers
[Advance]
Protocol data unit (PDU) is the generic term for “data” at each level
Encapsulation is the process of adding control information as it passes through the layered model
Protocol Data Unit and Encapsulation
The Application layer begins the process by delivering the data to the Transport layer
The Application data is broken into TCP segments and each segment is given a label, called a header▫ the header contains information about which process running
on the destination computer should receive the message▫ it also contains the information to enable the destination
process to reassemble the segments
The TCP segment is sent to the Internet layer and encapsulated within an IP packet, which adds an IP header▫ the IP header contains the source and destination IP
addresses
Sending Process
The IP packet is sent to the Network Access layer where it is encapsulated with a frame header and trailer▫ each frame header contains the source and destination physical
addresses▫ the trailer contains error checking information
Finally the bits are encoded onto the Ethernet media by the end-device network interface card (NIC)
Sending Process cont…
Sending Process cont…
Receiving Process
Data Encapsulation and Decapsulation
An exchange using the OSI model
[Advance]
Layer 7 Application Browsers Application
Layer 6 PresentationCommon Data Format
Application
Layer 5 SessionNFS, SQL, RPC, X-Win
Dialogues and Conversations
Application
Layer 4 Transport Computer Segment TCP and UDPQuality of Service, and Reliability
Transport
Layer 3 Network Router
Segment Network into Smaller Broadcast Domains
Packet
Routable Protocols. (IP, IPX, AppleTalk)
Path Selection, Routing, and Addressing
Internet
Data ProtocolsWords to Remember
TCP/IP Model
OSI Model Layer
EquipmentEquipment Purpose
OSI Model Name
Layer 2
Bridge (2 Ports) or Switch and NIC
Segment Network into Smaller Collision Domains
FrameNDIS, ODI, MAC Address, Ether Talk
Physical
Data Link -MAC -LLC
Layer 1 Physical BitSignals and Media
Network Access
Computer Data
Redirector, FTP, Telnet, SMTP, SNMP, Netware Core
Regular Computer or A Special
Gateway. Used to combine networks
using different communication
protocols
One Collision AND One Broadcast
Domain
Frames and Media Access Control (MAC)
Network Access
Repeater, Hub (Multi-port), Cabling
How the OSI and TCP/IP Models Relate in a Networking Environment
Addressing
Various types of addresses are needed to successfully deliver the data from a source application running on one host to the correct destination application running on another▫ Data Link physical addresses (MAC)▫ Network logical addresses (IP)▫ Transport service port numbers (Port)
Addressing
MAC Address
IP Address Port Number
MAC Addresses (6 Byte unique)
A MAC address is a unique 6-byte address that is burned into each network interface or more specifically, directly into the PROM chip on the NIC.
IPv4 Address
Each device on a network must be uniquely defined.
The packets of the communication need to be identified with the source and destination addresses of the two end systems
IPv4 is 32 bits in length and difficult for human to remember. Therefore, represent IPv4 addresses using dotted decimal format.
10101100.00010000.00000100.00010100 (172.16.4.20)
IP has two portion: network and host
network host
This is the physical address of the host (or end device)▫ in a LAN using Ethernet, this address is called the Media Access
Control (MAC) address Layer 2 addresses are used to communicate between
devices on a single local network
(packet)
Layer 2 Address (MAC address)
Ch 2 - 45
This is the logical address Layer 3 addresses are primarily used to move data from
one local network to another local network▫ enable intermediary network devices to locate hosts on
different networks
(segment)Network
209.165.200Device230
Layer 3 Address (IP address)
Why MAC and IP both Address?
1. Source and destination MAC change each time to transport packet from one device to another device.
2. Source and destination IP address is fixed.
[Advance]
Ch 2 - 47
At layer 4, the information contained in the PDU header identifies the specific process or service running on the destination host device▫ the separately running programs are examples of individual
processes
Layer 4 Service Port Number
Bank
Service Port Example
Cash Pay Counter
Cash Receive Counter
Electric Bill
Counter
Remittance Service Counter
Information Desk
………
Networking (PC)
Email/ SMTP
File Transfer/
FTPWeb/ HTTP
Telnet ……….
Different Service, different Counter
Different Service, different Port
Service Port List
Service Protocol Port
Mail SMTP 25
POP3 POP, POP3 110
Web HTTP 80
File Transfer FTP 20, 21
Telnet Telnet 23
Domain Name Resolution DNS 53
Dynamic Host Configuration DHCP 67, 68
Port numbers
Well known ports (Numbers 0 to 1023)
Registered Ports (Numbers 1024 to 49151)
Dynamic or Private Ports (Numbers 49152 to 65535)
The Internet Assigned Numbers Authority (IANA) assigns port numbers.
netstat
Relationship of layers and addresses in TCP/IP
[Advance]
Getting Data to the End Device
The host physical address, is contained in the header of the Layer 2 PDU, called a frame.
Layer 2 is concerned with the delivery of messages on a single local network.
The Layer 2 address is unique on the local network and represents the address of the end device on the physical media.
In a LAN using Ethernet, this address is called the Media Access Control (MAC) address.
When two end devices communicate on the local Ethernet network, the frames that are exchanged between them contain the destination and source MAC addresses.
Once a frame is successfully received by the destination host, the Layer 2 address information is removed as the data is decapsulated and moved up the protocol stack to Layer 3.
[Advance]
Getting the Data Through the Internetwork Layer 3 protocols are primarily designed to move data
from one local network to another local network within an internetwork.
Layer 3 addresses must include identifiers that enable intermediary network devices to locate hosts on different networks
At the boundary of each local network, an intermediary network device, usually a router, decapsulates the frame to read the destination host address contained in the header of the packet, the Layer 3 PDU
Routers use the network identifier portion of this address to determine which path to use to reach the destination host.
[Advance]
Getting Data to the Right Application
Think about a computer that has only one network interface on it. How to differentiate various type of data?
Each application or service is represented at Layer 4 by a port number
When the data is received at the host, the port number is examined to determine which application or process is the correct destination for the data
Example of popular port numbers?
[Advance]
OSI Reference Model at a Glance
Division of Layers
Upper Layers
Lower Layers
Middle Layer
7. Application
6. Presentation
5. Session
4. Transport
3. Network
2. Data Link
1. Physical
OSI – The Application Layer
Provides network services to the user's applications.
It does not provide services to any other OSI layer
***Think of any network application you use daily
OSI – The Presentation Layer
It ensures that the information that the application layer of one system sends out is readable by the application layer of another system.
*** Think of any common file formats (JPEG, txt etc)
OSI – The Session Layer
*** After you prepare your data, you need to establish the communication channels to send data
This layer establishes, manages, and terminates sessions between two communicating hosts.
It also synchronizes dialogue between the two hosts' presentation layers and manages their data exchange.
Application Layer Protocols
Domain Name Service (DNS)▫ used to resolve Internet names to IP addresses
Hypertext Transfer Protocol (HTTP)▫ used to transfer files that make up the web pages of the
world wide web Simple Mail Transfer Protocol (SMTP)
▫ used for the transfer of mail messages and attachments Telnet (terminal emulation protocol)
▫ used to provide remote access to servers and networking devices
File Transfer Protocol (FTP)▫ used for interactive file transfers between systems
Application Layer Software
Network-aware applications▫ implement the application layer protocols and are able
to communicate directly with the lower layers of the protocol stack
▫ e-mail clients and web browsers
Application layer services▫ are programs that interface with the network and
prepare the data for transfer▫ different types of data (text, graphics or video) require
different network services to ensure that it is properly prepared for processing by the functions occurring at the lower layers of the OSI model
DNS Service and Protocol
DNS uses TCP/UDP port 53 Domain names were created to convert the numeric IP
address into a simple, recognizable name
– domain names are easier to remember than actual numeric addresses
– any change to the address is transparent to the user since the domain name is the same
DNS Directory Structure
Uses a hierarchical structure to create a name database hierarchy is an inverted tree with the root at the top and branches
below The different top-level domains (TLD) represent either the country origin
or the type of organization
• After TLD are second-level domain names, and below them are other lower level domains
[Advance]
WWW Service and Protocol
• The web browser establishes a connection to the web service running on the server using the Hypertext Transfer Protocol (HTTP)▫ request a page using an URL (uniform resource locator) or web
address▫ a web browser is a client application running on a client device
• HTTP uses TCP port 80• An URL consists of three parts
▫ the protocol – hypertext transfer protocol (http)▫ the server name▫ the specific file name requested
• Browsers can interpret and present many data types▫ plain text and Hypertext Markup Language (HTML)▫ other data types require another service or program such as
plug-ins or add-ons
WWW Service and HTTP cont…
• The web client makes a connection to the HTTP server and requests a page
• In response to the request, the HTTP server returns the code for a web page
• The browser interprets the HTML code and displays a web page
HTTP Protocol
• HTTP specifies a request/response protocol▫ HTTP protocol uses three common messages – GET, POST and
PUT
• HTTP is not a secure protocol– POST messages in
plain text can be intercepted and read
– HTML pages are not encrypted
• HTTP Secure (HTTPS) protocol can use authentication and encryption to secure the data
E-mail Services and SMTP/POP3
User composes an e-mail using an application called a mail user agent (MUA) or e-mail client
Client sends e-mails to a server using Simple Mail Transfer Protocol (SMTP) and receives e-mails using Post Office Protocol version 3 (POP3)
SMTP uses TCP port 25 POP uses UDP port 110
Mail Transfer Agent
• The MTA process is used to forward e-mail▫ the MTA receives messages from a MUA or another MTA▫ based on the message header, it determines how a message has
to be forwarded to reach its destination
– if the recipient resides on the local server, the mail is passed to the mail delivery agent (MDA)
– if the recipient is not on the local server, the MTA routes the e-mail to the MTA on the appropriate server
Mail Delivery Agent
The MDA receives the inbound mail from the MTA and delivers the mail to the appropriate users’ mailboxes
It can also resolve final delivery issues, such as virus scanning, spam filtering and return-receipt handling
SMTP and POP
• POP and POP3 are inbound mail delivery protocols ▫ MDA listens for a client connection to the server
• SMTP governs the transfer of outbound e-mail from the sending client to the MDA, as well as the transport of e-mail between MTA– enables e-mail to
be transported across data networks between different types of server and client software
[Advance]
File Transfer Protocol
FTP uses TCP ports 20 (data) and 21 (commands and replies)
An FTP client is used to push and pull files from a server running the FTP daemon (FTPd)
TCP port 21
TCP port 20
• Client establishes the first connection to the server on TCP port 21– for control traffic
such as client commands and server replies
• Client establishes the second connection to the server over TCP port 20– for file transfer in
both direction
Telnet
• Telnet uses TCP port 23• Provides a method of emulating text-based terminals over
the network▫ allows a local device to access a remote device as if the
keyboard and monitor are connected to the remote device directly
• A connection using Telnet is called a virtual terminal (VTY) session
• The Telnet server runs a service called the Telnet daemon
OSI – The Transport Layer
Data will be segmented and send to destination device. Transport layer of destination device will reassemble them.
This layer handles details of reliable transfer. (ensures that the data arrive completely )
Basic functions of the Transport layer
Segmentation and Reassembly Conversation Multiplexing Plus :
▫ Connection-oriented conversations▫ Reliable delivery▫ Ordered data reconstruction▫ Flow control
Protocols
The two most common Transport layer protocols of TCP/IP protocol suite are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).
User Datagram Protocol (UDP)
UDP is a simple, connectionless protocol, described in RFC 768. It has the advantage of providing for low overhead data delivery. The pieces of communication in UDP are called datagrams. These datagrams are sent as "best effort" by this Transport layer
protocol.
8 bytes overhead
User Datagram Protocol
Applications that use UDP include:▫ Domain Name System (DNS)▫ Video Streaming▫ Voice over IP (VoIP)
Transmission Control Protocol (TCP)
TCP is a connection-oriented protocol, described in RFC 793.
Each TCP segment has 20 bytes of overhead in the header encapsulating the Application layer data.
Same order delivery
Reliable delivery
Flow control.
Transmission Control Protocol
Applications that use TCP are:▫ Web Browsers▫ E-mail ▫ File Transfers
OSI – The Network Layer
Many paths to the same destination. So, which path to follow?
Segmented data needs address to reach the destination (network address)
This layer handle 2 above stated issues.
Ch 5 - 80
Network Layer Processes
• Addressing▫ Network layer must provide a method for addressing the end
devices▫ each device must have a unique address
• Encapsulation▫ Network layer receives the Layer 4 PDU and adds a Layer 3
header▫ the Layer 3 header contains a source address, destination
address and other control information▫ this Layer 3 PDU is known as a packet▫ the packet is sent down to the Data Link
layer• Routing
▫ the Network layer must provide services to direct these packets to the destination host
▫ intermediary devices, called routers, are used to direct packets toward the destination
[Advance]
Ch 5 - 81
Network Layer Processes cont…
• Decapsulation▫ the destination host examines the destination address to verify
that the packet was addressed to this device▫ the packet is decapsulated by the Network layer and the Layer
4 PDU contained in the packet is passed up to the appropriate service at the Transport layer
encapsulation
decapsulation
[Advance]
OSI – The Data Link Layer
It provides means for exchanging data frames over a common media
To detect and possibly correct errors that may occur in the Physical layer
Physical Addressing, topologies and flow control
OSI – The Physical Layer
It defines the electrical, mechanical, procedural, and functional specifications for activating, maintaining, and deactivating the physical link between end systems.
Voltage levels, timing of voltage changes, physical data rates, maximum transmission distances, physical connectors, and other, similar, attributes defined by physical layer specifications.
Hands on
Binary Number System
Decimal: 10 digit 0 1 2 3 4 5 6 7 8 9 Octal: 8 digit 0 1 2 3 4 5 6 7 Hexadecimal: 16 digit 0 1 2 3 4 5 6 7 8 9 A B C D E F Binary: 2 digit 0 1
Computer only understand binary
Decimal: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Binary: 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111
{0,1} each called a bit , Binary Digit = Bit8 bit = 1 Byte1000 Byte (1024) = 1 Kilobyte1000 Kilobyte (1024) = 1 Megabyte1000 Megabyte (1024) = 1 Gigabyte1000 Gigabyte (1024) = 1 Terabyte …
MAC- Hexadecimal IP- Decimal
Decimal to Binary Conversion and vise versa
Thank you…