Protocol Architecture-Network Programming-Lecture Slides, Slides of Network Programming

This lecture was delivered for Network Programming course by Prof. Tausiq Dasgupta at Babasaheb Bhimrao Ambedkar University. It includes: Protocol, Architecture, Activation, Destination, Handshaking, Network, Access, module, Hardware, Datalink

Typology: Slides

2011/2012

Uploaded on 07/31/2012

dhanush
dhanush 🇮🇳

4

(3)

36 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
10/7/2009
1
Protocol Architecture
Protocol Tasks
Path Activation for a particular destination
Handshaking with destination
Link management
Application/Task specific requirements
Network Access Module Communication
Network
File Transfer Application
Communications Service
Module
Network Access Module
File Transfer Application
Communications Service
Module
Files and file transfer commands
Communications-related messages
Protocol Layers
Application
Session
Presentation
Transport
Network
Datalink
Physical
7
6
5
4
3
2
1
OSI Model
Application
TCP | | UDP
IPv4, IPv6
Device driver
and Hardware
Internet protocol
suite
Sockets
user
process
kernel
application
details
communication
details
Layers on OSI model and Internet protocol suite
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Protocol Architecture-Network Programming-Lecture Slides and more Slides Network Programming in PDF only on Docsity!

Protocol Architecture

 Protocol Tasks

 Path Activation for a particular destination

 Handshaking with destination

 Link management

 Application/Task specific requirements

Network Access Module Communication

Network

File Transfer Application

Communications Service Module

Network Access Module

File Transfer Application

Communications Service Module

Files and file transfer commands

Communications-related messages

Protocol Layers

Application

Session

Presentation

Transport

Network

Datalink

Physical

OSI Model

Application

TCP | | UDP

IPv4, IPv

Device driver

and Hardware

Internet protocol

suite

Sockets

user
process
kernel
application
details
communication
details

Layers on OSI model and Internet protocol suite

Open Systems Interconnect

 Developed by ISO

 7-layers communication model

 one large problem decomposed into several more manageable sub-problems

 supports modularity

 promotes interoperability between vendors

 widely used as reference model only

 TCP/IP developed in early 1970s by DoD

 designed to solve specific problems

 ISO established OSI committee in 1977

 expected that OSI would be universally adopted

 market required a solution, so TCP was adopted

 difficulties replacing TCP into OSI

OSI model

 Hierarchical set of 7 layers

 higher layers rely on lower ones to perform more primitive

functions

 changes in one layer should not require ones in other

layers, but it is not always possible

 functions and parameters passed at interface

 defines the functions to be performed at each layer

 facilitates the standards-making process

 standards can be developed independently and

simultaneously for each layer

The Seven Layers contd.

 Network layer

 provides for the transfer of information between end

systems across some sort of communications network

 network addressing

 Transport layer

 provides a mechanism for the exchange of data between

end systems

 ensures delivery of data

 error free, no losses, in sequence

 connection-oriented , connectionless

The Seven Layers contd.

 Session layer

 lowest four layers: provide the means for the reliable

exchange of data and provide an expedited data services

 some applications - control dialogue, backup and recovery

 provides the mechanism for controlling the dialogue

between applications in end systems

 dialogue discipline - full duplex or half duplex

 grouping - define groups of data

 recovery - a checkpointing mechanism

The Seven Layers contd.

 Presentation Layer

 offers application programs a set of data transformation

services

 defines syntax between applications

 Application Layer

 provides a means for application programs to access OSI

environment

 file transfer, electronic mail, remote terminal access etc.

Introduction

 Client / Server

Client Server

Communication link

Figure 1.1 Network application : client and server

Client

Client

Client

Server

...

...

Figure 1.2 Server handling multiple clients at the same time.

OSI Model

 Why do sockets provide the interface from the upper three layers of the OSI

model into the transport layer?

 First, the upper three layers handle all the details of the application and The

lower four layers handle all the communication details.

 Second, the upper three layers is called a user process while the lower four

layers are provided as part of the operating system kernel.

Application

Session

Presentation

Transport

Network

Datalink

Physical

OSI Model

Application

TCP | | UDP

IPv4, IPv

Device driver

and Hardware

Internet protocol

suite

Sockets

user
process
kernel
application
details
communication
details
Figure Layers on OSI model and Internet protocol suite

Network Classes

There are five classes of IP address with only the

first three relevant to the majority of users.

Classes A, B, and C are for general-purpose use;

classes D and E are reserved for special purposes

and future use.

Class A

Dotted Decimal Notation

Subnetting

 Subnetting is a method of locally modifying

the use of the network and hosts bits.

Routing

 Routing is the method by which packets of data are sent from

one computer to another in the most efficient way possible. The

routing process is composed of several components as follows:

 Determining what paths are available between the source and destination computers

 Selecting the “best” path between the source and destination computers where “best” may mean different things depending on the goals Using those paths to reach other computers

 Adjusting the datagram formats to fit into the underlying physical network technology

In a TCP/IP network, routing is performed by the IP layer. The network id of the destination computer’s IP address as well as the subnet mask are used by the IP layer to make routing decisions.

Unix Standards

 POSIX

 Potable Operating System Interface

 a family of standards being developed by IEEE

 The Open Group

 an international consortium of vendors and end-user

customers from industry, government, and academia.

 IETF (Internet Engineering Task Force)

 a large open international community of network

designers, operators, vendors, and researchers

concerned with the evolution of the Internet architecture

and the smooth operation of the internet.

TCP: Transmission Control Protocol

 Provides connections between clients and

servers.

 Provides reliability.

 RTT ( round-trip-time )

 TCP also sequences the data by associating

a sequence number with every byte that it

sends.

 TCP provides flow control.

 window

o A TCP connection is also full-duplex.

TCP Connection Establishment and Termination

 Three-Way Handshake

 SYN segment

 ACK

c l i ec l i ec l i ec l i e nnnn tttt s e r v es e r v es e r v es e r v e rrrr

socket,bind,listen socket accpet(blocks) connect(blocks) (action open)

connect returns

accept returns read(blocks)

SYN J

ack K + 1

SYN^ K^ , ack

J + 1

FFFF i gi gi gi g uuuu r er er er e 2. 22. 22. 22. 2 TCP three- way handshake

TCP Header

16- bit source port number 16- bit destination port number

32- bit sequence number

32- bit acknowledgment number

4- bit header 16- bit window size length

reserved (6bit)

16- bit TCP checksum 16- bit urgent pointer

option (if any)

data (if any)

F I N

S Y N

R S T

P S H

A C K

U R G

20 bytes

T CT CT CT C PPPP HHHH eeee aaaa dddd e re re re r

TCP Header FormatTCP Header FormatTCP Header FormatTCP Header Format

 Minimum of 20 Octets long

 Description of components:

 Source Port (16 bits):

 specifies sending user of TCP

 many common ports assigned special numbers

 Destination Port (16 bits)

 specifies receiving user of TCP

 Sequence Number (32 bits)

 number of first data octet in this segment

 octet bound, not segment bound: stream oriented

 Acknowledgment Number (32 bits)

 used for piggy-back acknowledgment

 contains sequence # of next octet destination expects to get

TCP Connection Establishment and Termination

(cont)

 TCP Options

 MSS option

 With this option the TCP sending the SYN announces

its maximum segment size , the maximum amount of

data that it is willing to accept in each TCP segment,

on this connection.

 Window Scale option

 Timestamp option

 TCP Connection Termination

 half-close : Between steps 2 and 3 it is possible for data to flow from the end

doing the passive close to the end doing active close.

TCP Connection Establishment and Termination

(cont)

cccc l i e nl i e nl i e nl i e n tttt s e r v e rs e r v e rs e r v e rs e r v e r

close

close (active close)

connect returns

(passive close) read returns 0

FIN M

ack N + 1

ack^ M^ + 1

FFFF i gi gi gi g u r eu r eu r eu r e (^) 2. 32. 32. 32. 3 Packets exchanged when a TCP connection is closed.

FIN^ N

TCP

Connection

Establishme

nt and

Termination

(cont)

CLOSED

LISTEN

ESTABLISHED

SYN_RCVD SYN_SENT

CLOSE_WAIT

FIN_WAIT_1 CLOSING LAST_ACK

FIN_WAIT_2 TIME_WAIT

starting point

passive open

data transfer state

active open

simultaneous close

2MSL timeout

passive close

appl: passive open send: < nothing>

appl: active open sen d : SYN

rec v: SYN;

s en d : SYN , ACK rec v: RST recv: SYN send: SYN, ACK sen d : < n o thing >^ re c v: AC K^ simultaneous open

re c v: SYN, ACK recv: FINsen d : ACK send: ACK

recv: ACK send: < nothing>

appl: close or timeout

recv : close send: FIN appl: c lose sen d : FIN

recv : ACK send: < nothing>

recv : FIN send: ACK

re cv: FIN , AC K sen d : AC K

recv : FIN send: ACK

recv : ACK send: < nothing>

active close

FFFF i gi gi gi g u r eu r eu r eu r e 2222. 4. 4. 4. 4 TCP state transition diagram

  • State

transition

diagram

 Watching

the Packets

TCP Connection Establishment and Termination

(cont) (^) c l i e n t ccc l i e nl i e nl i e n ttt^ s e r v e rs e r v e rs e r v e rs e r v e r socket,bind,listen LISTEN(passive open) accpet(blocks)

socket connect(blocks) (action open) SYN_SENT

ESTABLISHED connect returns ESTABLISHED accept returns read(blocks)

SYN J , m ss = 1460

ack K + 1

SYN^ K^ , ack^ J

  • 1 , m ss =^1024

FFFF i gi gi gi g u r eu r eu r eu r e 2222. 5. 5. 5. 5 Packet exchange for TCP connection

close LAST_ACK

close (active close) FIN_WAIT_ CLOSE_WAIT (passive close) read returns 0

FIN M

ac k N + 1

ack^ M^ + 1

FIN^ N

write read(blocks) read returns

read returns

write read(blocks)

CLOSED

FIN_WAIT_ TIME_WAIT

data ( reply) ack of req uest

data( request)

ack o f reply