You are on page 1of 628

Welcome

Lt Col Chandan Tiwari

DATA COMMUNICATION AND COMPUTER NETWORKS INTRODUCTION

Data comn are the exchange of data b/w two devices via some form of txn medium such as wire cable. These comn devices must be part of a comn sys (combination of HW & SW) Effectiveness of data comn depends upon
Delivery Accuracy Timeliness Jitter

Lt Col Chandan Tiwari

Source Generates data to be transmitted Transmitter Converts data into transmittable signals Transmission System Carries data Receiver Converts received signal into data Destination Takes incoming data
Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Message Sender Receiver Txn Media Protocol

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Simplex Half - Duplex Full - Duplex

Lt Col Chandan Tiwari

Simplex

Lt Col Chandan Tiwari

Half-Duplex

Lt Col Chandan Tiwari

Full-Duplex

Lt Col Chandan Tiwari

data flows move in one direction only, (radio or cable television broadcasts)

data flows both ways, but only one direction at a time (e.g., CB radio) (requires control info)

data flows in both directions at the same time


Lt Col Chandan Tiwari

NETWORKS

Lt Col Chandan Tiwari

A network is a set of devices(referred as nodes) connected by comn ch. Node can be any device capable of sending/ receiving data generated by other nodes on the network.

Lt Col Chandan Tiwari

Computer Network
Computer Network is a collection of autonomous computers interconnected by a single technology. eg Ethernet LAN Is Internet a computer network?

Lt Col Chandan Tiwari

Distributed System is a collection of independent computers that appear to its users as a single coherent system
Existence of multiple autonomous computers is transparent It is like a virtual uniprocessor Implemented in SW and build over computer networks

Lt Col Chandan Tiwari

Performance
Throughput (High) Delay (Low)

Reliability Security

Lt Col Chandan Tiwari

Computers connected over a network can make that information exchange easier and faster. The information moves directly from computer to computer rather than through a human intermediary. People can concentrate on getting their work done rather than on moving information around the company.
Lt Col Chandan Tiwari

Resource Sharing Robustness Load Balancing Location Independence Productivity

Lt Col Chandan Tiwari

Based on transmission technology


Broadcast networks Pt-to-Pt networks

Based on scale
Personal Area Networks (PAN) Local Area Networks (LAN) Metropolitan Area Networks (MAN) Wide Area Networks (WAN)

Lt Col Chandan Tiwari

Pt to Pt Broadcast Topology Based Cct SW Vs Message SW Vs Packet Sw

Lt Col Chandan Tiwari

Broadcast Networks
Single comn channel shared by all cmptrs Packets send by one cmptr received by all others. Address in packet- specifies for whom intended. Packet can also be addressed to all cmptrs (broadcast) or a gp of cmptrs(Multicasting) Smaller networks broadcast Eg Ethernet(802.3),IBM Token Ring(802.5)

Lt Col Chandan Tiwari

Single comn channel shared by all cmptrs on NW. Packets sent by one cmptr received by all others. Address fd in packet- specifies for whom intended. Packet can also be addressed to all cmptrs (broadcast). Some networks also support multicasting
Lt Col Chandan Tiwari

Point To Point Networks


Many connections between indl pairs of cmptrs. Packets visit one or more intermediate machines. Multiple routes . Routing algorithm To determine the best route

Also called as unicasting


Larger networks pt to pt Eg. WAN

Lt Col Chandan Tiwari

Many connections between indl pairs of cmptrs. Packets visit one or more intermediate machines. Multiple routes. Routing algorithm. Smaller networks broadcast larger networks pt to pt
Lt Col Chandan Tiwari

LAN WAN

MAN

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

A local area network (LAN) is a number of computers connected to each other by cable in a single location by a common medium i.e switch, hub and etc, usually a single floor of a building or all the computers in a small company within the geographical area.
Lt Col Chandan Tiwari

Local Area Networks(LAN)


Within same building/ campus - upto a few kms. Speed 4/16/10/100/1000 Mbps. Normally broadcast type Topology (bus,ring, star)

Restricted in size- worst case txn time is bounded and known in advance.eg 10 Mbps Ethernet LAN(10 BaseT) has max dia of 500m
Simple network management Eg- Ethernet(802.3),IBM Token Ring(802.5),WiLt Col Chandan Tiwari Fi(802.11,Wireless LAN)

Tree

Bus Star

Hybrid Mesh
Lt Col Chandan Tiwari

Operates within the limited geographical area. Allow access through high bandwidth up to 1000 mbps. Controls the network under local administration

Provides the full time connectivity to local system.


Connects physical adjacent devices.

Lt Col Chandan Tiwari

Metropolitan Area Networks(MAN)


Bigger version of LAN.

Uses similar technology as LAN.


Can cover a city. Eg- Wi-Max(802.16,Wireless MAN)

Lt Col Chandan Tiwari

While local area networks are perfect for sharing resources within a building or campus, they cannot be used to connect distant sites. Wide area networks (WANs) fill this need. Stated simply, wide area networks are the set of connecting links between local area networks. These links are made over telephone lines leased from the various telephone companies. In rare instances, WANs can be created with satellite links, packet radio, or microwave transceivers. These options are generally far more expensive than leased telephone lines, but they can operate in areas where leased lines are not available.
Lt Col Chandan Tiwari

A wide area network links computers in different locations.

ARMY HQ New Delhi

MCEME Secunderabad

Lt Col Chandan Tiwari

Operates over a large geographical area.


Allow access over serial interface

Works at a local speed 2mbps is maximum speed


in internet.

Connects devices separates wide even global area.

Lt Col Chandan Tiwari

Wide Area Networks(WAN)


Spans larger geographical area. Collection of cmptrs (hosts) connected by a comn subnet Subnet consists of :Transmission lines. Switching elements (or routers). Packet sent from router to router. (Store and fwd / packet switching) Gen Pt to Pt Topologies
Lt Col Chandan Tiwari

Star Mesh Ring Bus Hierarchical


To reduce complexity of NW Better comd & contrl Better mgmt
Lt Col Chandan Tiwari

Tiered Architecture

Point-to-Point Line Configuration

Lt Col Chandan Tiwari

Point-to-Point Line Configuration

Lt Col Chandan Tiwari

Point-to-Point Line Configuration

Lt Col Chandan Tiwari

Multipoint Line Configuration

Lt Col Chandan Tiwari

Mesh Topology

Lt Col Chandan Tiwari

Star Topology

Lt Col Chandan Tiwari

Tree Topology

Lt Col Chandan Tiwari

Bus Topology

Lt Col Chandan Tiwari

Ring Topology

Lt Col Chandan Tiwari

Hybrid Topology

Lt Col Chandan Tiwari

Data Transmission
Lt Col Chandan Tiwari

Baseband

Lt Col Chandan Tiwari

Broadband

Lt Col Chandan Tiwari

Bandwidth is the capacity of a medium to convey data. One example of bandwidth is automobile traffic. A two-lane road with a speed limit can accommodate only so many cars before there are too many and a traffic jam results. You can increase the bandwidth of a road by
making the cars travel more quickly (which corresponds to using a faster transmission method in networks) or by making the road wider (which corresponds to using more wires in networks).
Lt Col Chandan Tiwari

Means sending a digital signal over channel w/o changing digital signal to an analog signal. The cable connecting the computer can carry one signal at a time, and all the system take turn using it. This type of network is called Base band network. In the base band network, when a computer transmits data it might be broken into many packet and transmits separately. The receiving system reassembles them back into original. This is called packet switching network.

Lt Col Chandan Tiwari

HELLO HOW ARE YOU

YOU ARE HELLO HOW

The alternative to a packet switching network is cct switching. In CSN two system established a cct before communication and broken cct only after the finish the Lt Col Chandan Tiwari communication between them.

Means changing the digital signal to an analog signal for transmission. In the broad band net work carries multiple signals in a single cable at a same time . The example of broad band network is cable TV. In a single cable carries multiple channels
Lt Col Chandan Tiwari

With in a node
Encoding Framing Addressing Routing Reliability Security

Lt Col Chandan Tiwari

VOIP

FTP

Telnet

Co-ax

Wireless
Lt Col Chandan Tiwari

OFC

Applications need to be tuned to Physical Layer without layering. Adding a new application requires O(m) Complexity work. Adding a new media requires O(a) complexity work.

Lt Col Chandan Tiwari

VOIP

FTP

Telnet

Co-ax

Wireless
Lt Col Chandan Tiwari

OFC

Different layers need not to worry about what other layers/ final layer is, interface does it all. Adding a new application/ media requires O(1) Complexity work.

Lt Col Chandan Tiwari

Single comn channel shared by all cmptrs on NW. Packets sent by one cmptr received by all others. Address fd in packet- specifies for whom intended. Packet can also be addressed to all cmptrs (broadcast). Some networks also support multicasting
Lt Col Chandan Tiwari

Many connections between indl pairs of cmptrs. Packets visit one or more intermediate machines. Multiple routes. Routing algorithm. Smaller networks broadcast larger networks pt to pt
Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Addressing Rules of data transfer Error control Flow control Capability to handle arbitrary long msgs
Dis-assembly Txn Re-assembly

Routing Multiplexing
Lt Col Chandan Tiwari

Computer NWs are often described using layered architecture Layered architecture specifies functionality at each layer (modularity) Higher layer protocols can operate without knowing details of the lower layers .

Lt Col Chandan Tiwari

Fundamental idea is to provide a service but keep details of implementation i.e. internal state and algorithms, at each level hidden.
Info hiding. Abstraction Data encapsulation.

Lt Col Chandan Tiwari

Reduces complexity by dividing one big problem to several smaller ones Standardizes interfaces Facilitates modular engineering Assures interoperable technology Accelerates evolution Simplifies teaching and learning
Lt Col Chandan Tiwari

Well defined function by each layer Minimise info flow across interfaces Balanced number of layers

Lt Col Chandan Tiwari

Layering hides information If it did not (layering violation) then changes to one layer could require changes everywhere Sometimes hiding information can degrade performance

Lt Col Chandan Tiwari

Example.
flow control protocol at an upper layer may think packet loss is always because of network congestion But if it is due to a lossy link then performance degrades. So hiding information about reason of packet loss from flow control protocol leads to degraded performance

Lt Col Chandan Tiwari

Conflict between information-hiding and achieving good performance Leak enough information to allow good performance but not so much that small changes in one layer need changes to other layers

Lt Col Chandan Tiwari

Country 1

Country 2 Customer B

Peer entities

Customer A

Worker A

Worker B

Postal Network

Customer A and B are peer entities Postal worker A and B are peer entities
Lt Col Chandan Tiwari

A protocol is a set of rules and formats that govern the communication between peers
set of valid messages meaning of each message

A protocol is necessary for any function that requires cooperation between peers

Lt Col Chandan Tiwari

Problem: Exchange a file over a network that may corrupt packets but doesnt lose or reorder them A simple protocol
send file as a series of packets send a checksum receiver sends OK or not-OK message sender waits for OK message if no response, resends entire file
Lt Col Chandan Tiwari

Syntax of a message
what fields does it contain?
in what format?

Semantics of a message
what does a message mean? for example, not-OK message means receiver got a corrupted file

Actions to take on receipt of a message


for example, on receiving not-OK message, retransmit the entire file Lt Col Chandan Tiwari

Switching

Lt Col Chandan Tiwari

Circuit Switch
Lt Col Chandan Tiwari

Packet Switch
Lt Col Chandan Tiwari

SWITCHING

Lt Col Chandan Tiwari

A network is a set of connected devices. Prob how to connect them for one to one comn
Pt to Pt
Different topology

Switching
SW NW consists of a series of interlinked nodes, called switches. SW are capable of creating temp conn b/w two or more devices linked to SW.
Lt Col Chandan Tiwari

The end devices are called stations. The switching devices are called nodes. Key features of a switched communication network
Network Topology is not regular. Uses FDM or TDM for node-to-node communication. There exist multiple paths between a sourcedestination pair for better network reliability. The switching nodes are not concerned with the contents of data. Their purpose is to provide a switching facility that will move data from node to node until they reach the destination. Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Circuit SW Packet SW Message SW

Lt Col Chandan Tiwari

Switched Networks

Circuit Switched NW

Packet Switched NW

Message Switched NW

Datagram NW

Virtual Circuit NW

Lt Col Chandan Tiwari

circuit switching implies that there is a dedicated communication path between the two stations. The path is a connected through a sequence of links between network nodes. On each physical link, a logical channel is dedicated to the connection.

Lt Col Chandan Tiwari

Circuit SW takes place at the physical layer Before starting comn, the stn must make a reservation of resources.
BW in FDM / time slots in TDM SW Buffers SW processing time SW input/output port

Data transfer are not packetized (Physical layer transfer), data are continuous flow No addressing involved during data transfer SWs route the data based on their occupied band(FDM) or time slot (TDM)
Lt Col Chandan Tiwari

Setup Phase
End to End addressing reqd Conn est only after ack

Data Transfer Phase Teardown Phase


Sig is sent to each SW to release the resources

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

D E L A Y

Lt Col Chandan Tiwari

Efficiency
Low

Delay
Minimal No waiting at SWs Total delay = Time to est conn + transfer Data + Disconnect the circuit

Data propagation delay


5msec per 1000km

No congestion No Busy signal


Lt Col Chandan Tiwari

MESSAGE SW

Lt Col Chandan Tiwari

No reservation of resources Block of data to be sent Stored in the first sw office, then fwd later one hop at a time. Each block is recd in its entirety, inspected for errors, and then transmitted. Also called store and fwd NW No upper limit on block size
Means router must have disk to buffer along blocks It also means that a single block can tie up a routerrouter line for minutes, rendering message switching useless for interactive traffic.
Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

PACKET SW

Lt Col Chandan Tiwari

Packet-switching networks place a tight upper limit on block size. Allowing packets to be buffered in router main memory instead of on disk. By making sure that no user can monopolize any transmission line very long (milliseconds) Packet-switching networks are well suited for handling interactive traffic. Connectionless Networks Each pkt is treated the same. Each pkt is treated independently.
Lt Col Chandan Tiwari

Every pkt carries a header with dest addsd Each Sw maint a routing table based on dest addsd These are dynamic and are updated periodically Dest addsd and output port are recorded

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

The first packet of a multi-packet message can be forwarded before the second one has fully arrived, reducing delay and improving throughput. Efficiency is better than circuit sw. Delay may be more and not uniform. More fault tolerant than Circuit SW. Congestion may occur. Trade off between guaranteed services and wasting resources Vs not guaranteeing services and not wasting resources.
Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

AN OVERVIEW OF OSI REFERENCE MODEL

Lt Col Chandan Tiwari

OSI Reference Model


International Organisation for Standardisation (ISO) international organisation responsible for a wide range of standards.

1984 - Open Systems Interconnection (OSI) Reference Model approved as international std for comn architecture to aid NW interconnection without necessarily requiring complete redesign.
Lt Col Chandan Tiwari

Formally defines the architecture i.e. layers, services, etc. Describes how data makes its way from application programs on one computer to an application program located on another computer over NW medium. Divides problem of moving info between computers over a NW medium into SEVEN smaller and more manageable problems.
Lt Col Chandan Tiwari

7
6 5

Application
Presentation Session

4
3 2 1

Transport
Network Data Link Physical

Lt Col Chandan Tiwari

7
NIC Card

Application Presentation Session Transport Network

6 5 4 3

2
1

Data Link
Physical
Hub

Lt Col Chandan Tiwari

7 6 5 4 3 2 1

Application Presentation Session Transport Network Data Link Physical

Host layers: Provide


accurate data delivery between computers

Media layers: Control


physical delivery of messages over the network

Lt Col Chandan Tiwari

Application

Provides network services to application processes (such as electronic mail, file transfer, and terminal emulation)

Lt Col Chandan Tiwari

7 6

Application

Network services to applications Data representation Ensures data is readable by receiving system Format of data Data structures Negotiates data transfer syntax for application layer

Presentation

Lt Col Chandan Tiwari

7 6 5

Application

Network services to applications Data representation Inter-host communication Establishes, manages, and terminates sessions between applications

Presentation
Session

Lt Col Chandan Tiwari

7 6 5

Application

Network services to applications Data representation Inter-host communication End-to-end connection reliability
Concerned with data transport issues between hosts Data transport reliability Establishes, maintains, and terminates virtual circuits Fault detection and recovery Information flow control

Presentation
Session

Transport

Lt Col Chandan Tiwari

7 6 5

Application

Network services to applications Data representation Inter-host communication End-to-end connection reliability Addresses and best path
Identifying source and destination Path selection between two systems (routing)

Presentation
Session

4
3

Transport
Network

Lt Col Chandan Tiwari

7 6 5 4

Application Presentation Session Transport Network Data Link

Network services to applications Data representation

Inter-host communication End-to-end connection reliability


Addresses and best path Access to media
Provides reliable transfer of data across media Physical addressing, network topology, error notification, flow control

3
2

Lt Col Chandan Tiwari

Application
Presentation Session Transport Network Data Link Physical

Network services to applications

6
5 4 3 2 1

Data representation
Inter-host communication End-to-end connection reliability

Addresses and best path


Access to media Binary transmission Wires, connectors, voltages, data rates

Lt Col Chandan Tiwari

Host A 7 6 5 4 3 2 1 Application Presentation Session Transport Network Data Link Bits Physical PDUs PDUs

Host B Application Presentation Session

PDUs
Segments Packets Frames

Transport
Network Data Link Physical

Lt Col Chandan Tiwari

Host A
Application Presentation

Host B

Session
Transport Network Data Link Physical
Lt Col Chandan Tiwari

} {
Data

Application Presentation

Session
Transport Network Data Link Physical

Host A
Application Presentation

Host B

Session
Transport Network Data Link Physical
Lt Col Chandan Tiwari

} {
Data Network Data Header

Application Presentation

Session
Transport Network Data Link Physical

Host A
Application Presentation

Host B

Session
Transport Network Data Link Physical
Lt Col Chandan Tiwari

} {
Data Network Data Header Frame Network Header Header Frame Trailer Data

Application Presentation

Session
Transport Network Data Link Physical

Lt Col Chandan Tiwari

source
datagram Hn Ht
Hl Hn Ht

message segment Ht

M M M M

frame

Data Encapsulation

application transport network link physical


Hl Hn Ht M

link physical

Hl Hn Ht

switch

destination
M
Ht Hn Ht Hl Hn Ht M M M

application transport network link physical

Hn Ht Hl Hn Ht

M M

network link physical

Hn Ht Hl Hn Ht

M M

router
Lt Col Chandan Tiwari

OSI Reference Model is composed of seven layers, each specifying distinct network functions. Process of breaking up the functions or tasks of networking into layers reduces complexity. Each layer provides a service to the layer above it. Each layer communicates with its peer layers software or hardware on other computers. Lower three layers (network, data link and physical Layers 3, 2, and 1) are media layers and control physical delivery of data over the NW. Upper four layers of the OSI model (application, presentation, session and transportLayers 7, 6, 5 and 4) are host layers and provide accurate end to end data delivery between computers. Data is Encapsulated with the necessary protocol information as it moves down the layers before network transit.
Lt Col Chandan Tiwari

Layer 1
Physical Layer

Lt Col Chandan Tiwari

Moves bits between physically connected systems It defines


Mechanical and electrical specifications of the interface and transmission medium Procedures and functions of the physical devices and interfaces

Lt Col Chandan Tiwari

It includes
coding scheme to represent a bit bit-level synchronization Data rate (transmission rate) shapes and sizes of connectors

Lt Col Chandan Tiwari

Layer 2
Data Link Layer

Lt Col Chandan Tiwari

Reliable communication over a single link. Introduces the notion of a frame


set of bits that belong together

Begin and end markers delimit a frame

Lt Col Chandan Tiwari

On a broadcast link (such as Ethernet)


end-system must receive only bits meant for it need datalink-layer address also need to decide who gets to speak next these functions are provided by Medium Access Sublayer

Lt Col Chandan Tiwari

DLL protocols are the first layer of SW & heavily dependent on underlying physical link properties. Hence, both physical and data link layers are usually bundled together on Network Interface Card

Lt Col Chandan Tiwari

Also responsible for


error notification, ordered delivery of frames and flow control

Enables data to locate its intended destination on NW using Media Access Control (MAC) addresses. MAC address allow multiple stations to share the same medium and still uniquely identify each other. Provides reliable comn
Lt Col Chandan Tiwari

24 bits

24 bits

Vendor Code

Serial Number

2b5f.0c12. 3a56
ROM RAM

MAC address is burned into ROM on a network interface card Can it be changed? (OTW)
Lt Col Chandan Tiwari

Layer 3
Network Layer

Lt Col Chandan Tiwari

Breaks Transport Layer PDUs into packets and ensures their delivery Defines logical addressing Responsible for routing on the NW (Routers operate at this layer) Found both in end-systems and in intermediate systems

Lt Col Chandan Tiwari

Which Which Path? Path?

Layer 3 functions to find the best path through the network


Lt Col Chandan Tiwari

Network 1

Node

1 2 3
1 1

2.1 1.2 1.3 1.1 3.1

2 3

Network addressPath part used by the router Node addressSpecific port or device on the network
Lt Col Chandan Tiwari

General Example

Network 1

Node

TCP/IP Example

Network 10.

Host 8.2.48 (Mask 255.0.0.0)

Novell IPX Example

Network 1aceb0b.

Node 0000.0c00.6e25

Lt Col Chandan Tiwari

X
A A B B

C C

Host X
Application Presentation Session Transport Network Data Link Physical

Host Y
Application Presentation Session Transport Network Data Link Physical

Router A
Network Data Link Physical

Router B
Network Data Link Physical

Router C
Network Data Link Physical

Lt Col Chandan Tiwari

Routing Tables

IPX 3a.0800.5678.12ab IP 15.16.50.3

Novell Apple
IPX 4b.0800.0121.ab13

DEC

IP

Token Ring

AppleTalk 100.110
VAX

DECnet 5.8

Token Ring

VAX

IP 15.16.42.8 AppleTalk 200.167


Lt Col Chandan Tiwari

DECnet 10.1

IP 15.17.132.6

Routers handle traffic from diverse routed protocols over the internetwork

Static Route Uses a route that a network administrator enters into the router

Dynamic Route Uses a route that a network protocol adjusts automatically for topology or traffic changes

Lt Col Chandan Tiwari

A A

Point-to-point or circuit-switched connection

Only a single network connection with no need for routing updates

B B Stub network

Fixed route to address reflects administrators knowledge


Lt Col Chandan Tiwari

A A

B B

X
D D C C

Can an alternate route substitute for a failed route? Yes but With dynamic routing enabled
Lt Col Chandan Tiwari

From LAN Host 4 Network 1


802.3 Net 2, Host 5

to LAN Network 3 E0 E1 To0 Network 2


Token Ring

Host 5

802.5 Net 2, Host 5

Routing Table
Destination Outgoing Network Interface 1 2 3
Lt Col Chandan Tiwari

E0 To0 E1

Data

From LAN

1.3 2.4 Data

1.3

Token Ring

Token Ring

1.3 2.4 Data 1.3 2.4 Data

To WAN

A A
Frame Relay

Frame Relay 1.3 2.4 Data 1.3 2.4 Data

To LAN

2.4

B B Ethernet 1.3 2.4 Data 1.3 2.4 Data Data

Lt Col Chandan Tiwari

Layer 4
Transport Layer

Lt Col Chandan Tiwari

Reliable end-to-end communication. Transport layer creates the abstraction of an error-controlled, flow-controlled and multiplexed end-to-end link Segments PDUs from Session layer and sends segments from one end host to another

Lt Col Chandan Tiwari

Error control
message will reach destination despite packet loss, corruption and duplication retransmit lost packets; detect and discard duplicated packets; detect, discard, and retransmit corrupted packets

Flow control
match transmission rate to the rate currently sustainable on the path to destination, and at the destination itself

Lt Col Chandan Tiwari

Transport layer

Multiplexes multiple applications to the same end-to-end connection


adds an application-specific identifier (port number) so that receiving end-system can hand in incoming packet to the correct application

Lt Col Chandan Tiwari

Establishes Connection

Sender

Receiver

Request Connection Negotiate Connection

Connection Established
Data Transfer (Send Segments)

Lt Col Chandan Tiwari

Transmit
Sender Receiver

Stop

Not Ready

Buffer Full Process Segments

Go

Ready Resume Transmission

Buffer OK

Lt Col Chandan Tiwari

Window Size = 1
Send 1
Sender

Receive 1 Ack 2 Receive 2 Ack 3 Window Size = 3


Receiver

Send 2

Sender

Send 1 Send 2 Send 3 Send 4

Receive 1 Receive 2 Receive 3 Ack 4

Receiver

Lt Col Chandan Tiwari

Sender 1 2 3 4 5 6 7 1

Receiver 2 3 4 5 6 7

Send 1 Send 2 Send 3 Ack 4 Send 4 Send 5 Send 6 Ack 5 Send 5 Ack 7
Lt Col Chandan Tiwari

Layer 5
Session Layer

Lt Col Chandan Tiwari

Not common Establishes, manages, and terminates sessions between applications Provides full-duplex service, expedited data delivery, and session synchronization

Lt Col Chandan Tiwari

Duplex
if transport layer is simplex, concatenates two transport endpoints together

Expedited data delivery


allows some messages to skip ahead in endsystem queues, by using a separate lowdelay transport layer endpoint

Synchronization
allows users to place marks in data stream and to roll back to a pre-specified mark
Lt Col Chandan Tiwari

Layer 6
Presentation Layer

Lt Col Chandan Tiwari

Unlike other layers which deal with headers, presentation layer also touches the application data Hides data representation differences between applications. For example:
Endian-ness Characters (ASCII, unicode, EBCDIC.)

Can also encrypt data Compression


Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Layer 7
Application Layer

Lt Col Chandan Tiwari

Closest to the user. Provides network services to the users applications. Application layer establishes the availability of intended communication partners, synchronizes and establishes agreement on procedures control of data integrity. Differs from other layers in that it does not provide services to any other OSI layer, but rather, only to applications outside the OSI model. Examples of such applications are Spreadsheet programs, Network virtual terminal, Mail services, Directory services, File transfer, access, and management.

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

TCP/ IP REFERENCE MODEL

Lt Col Chandan Tiwari

Research sponsored by United States DoD Major design goals Ability to connect multiple NWs seamlessly Survivability Flexible architecture to cater for applications with divergent requirements DoD wanted connections to remain intact as long as source and destination machines were intact.

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

No specs laid down Only says that host has to connect to NW using some protocol so that it can send IP packets over it Varies from host to host & NW to NW

Lt Col Chandan Tiwari

Connectionless packet switched service Uses Internet Protocol (IP) which defines packets Permit injection of packets into any NW and have them travel independently to the destination Packet routing and congestion control are major issues. Similar to OSI Network Layer .

Lt Col Chandan Tiwari

Designed to allow conversation between peer entities on source and destination hosts Similar to OSI Transport Layer. Two protocols defined for this layer:
Transmission Control Protocol (TCP) - handles flow control and
sequencing. Reliable connection oriented protocol

User Datagram Protocol (UDP) prompt delivery more important


than accurate delivery. Unreliable connectionless protocol

Lt Col Chandan Tiwari

No session or presentation layer. Application layer serves as the communication interface Protocols - Virtual terminal (telnet), FTP, SMTP, DNS,
HTTP, etc.

for users by providing specific application services to the user

Lt Col Chandan Tiwari

TCP/IP reference models development preceded the OSI model by several years. Unlike OSI, TCP/IP was never intended to be an international standard. TCP/IP was not designed with layers and does not fit neatly into OSI models 7 layers. OSI introduces the concept of Services, Interfaces and Protocols. TCP/IP model originally did not distinguish between these.

Lt Col Chandan Tiwari

Protocols better hidden in OSI model and thus easily replaced with change in technology In OSI model, protocols were invented after model was devised. In TCP/IP model, protocols came first and model was merely description of protocols

Lt Col Chandan Tiwari

ADDRESSES

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

MAC SUB LAYER

Lt Col Chandan Tiwari

We have studied DLL protocols for Point to Point Connections. NW could also be Broadcast NW. Broadcast channels also referred to as Multiaccess Channels or Random access Channels. Key Issue Who gets to use the broadcast channel in case of more than one contender? Protocols used to decide this belong to Medium Access Control Sub Layer which is part of DLL.

Lt Col Chandan Tiwari

Static allocation The channel BW is divided equally among users. Unused bandwidth will be lost. Dynamic allocation Users able to access unused bandwidth from others. There is no dedicated bandwidth.

Lt Col Chandan Tiwari

Traditional method example - Frequency Division Multiplexing (FDM).

Involves splitting up the usable frequency into smaller channels.


Unused bandwidth will be wasted, but the allocated bandwidth is guaranteed. Simple and efficient for known workloads.

Lt Col Chandan Tiwari

Larger the number of users, smaller are the FDM channels.

In computer systems, data is generally bursty, thus, FDM results in poor bandwidth utilization as stn is idle for most of the time. Data bursts from one computer will take a long time to travel over the bandwidth, while other computers may not be using their resources. Similar is the case for Time Division Multiplexing (TDM)
Lt Col Chandan Tiwari

Key assumptions: Station Model The network consists of independent stations (or computers). All stations are considered to be equal. They produce frames to be transmitted. Once a frame is generated the station is blocked and does nothing until the frame has been successfully transmitted.
Lt Col Chandan Tiwari

Single Channel Assumption There will be a single channel for all of the terminals to communicate on. All stations can transmit and receive on it.

Lt Col Chandan Tiwari

Collision Assumption If two frames are transmitted at the same time, they will collide. In a collision, both frames are completely lost. Frames that have collided must be retransmitted. All stations can detect collisions. There are no errors other than those generated by collision.

Lt Col Chandan Tiwari

Time itself may be Continuous or Slotted Time Continuous Time Frame transmission can begin at any instant. There are no discrete time intervals. Slotted Time
Time is divided into discrete intervals (slots) Data can only be transmitted in a slot.

Slots can contain 0, 1, or more frames.


0 frames = empty slot 1 frame = data transmission

2+ frames = collision
Lt Col Chandan Tiwari

Carrier Sense The terminal can sense if the channel is busy No terminal will transmit until the channel is idle No Carrier Sense The terminal cannot sense if the channel is busy Terminals will transmit and check for collisions later.

LANs generally use Carrier Sense but not satellite networks. Why?
Lt Col Chandan Tiwari

If more than 2 users send at the same time - collision All collided packets are lost -> waste of bandwidth Ideally, the MAC protocol for a broadcast channel with the bit-rate R bps should satisfy: if only 1 node is sending then the throughput is R when M nodes have data to send than the throughput is R/M decentralized protocol no master simple & inexpensive to implement

Lt Col Chandan Tiwari

Carrier Sense Multiple Access Protocols (CSMA) Collision-Free Protocols Wireless LAN Protocols

Lt Col Chandan Tiwari

Protocols in which nodes listen for a carrier and act accordingly are called CSMA Protocols.

Persistent CSMA
Non Persistent CSMA CSMA with Collision Detection (CSMA/CD)

Lt Col Chandan Tiwari

Stn monitors the channel until it is idle. Once it is idle, the Stn transmits. If a collision occurs the stn waits for a random amount of time and starts all over again.

Known as 1-persistent because the probability that it will transmit on an idle channel is 1.

Lt Col Chandan Tiwari

Longer is the propagation delay, worse is the performance of the protocol


Lt Col Chandan Tiwari

Limitations of 1 persistent protocol Propagation Delay.

Simultaneous Txn will result in collisions.

Lt Col Chandan Tiwari

Before sending Node senses the channel. If idle it transmits its frame. If channel is busy, the node waits for random time and then repeats the algorithm. Less greedy than 1-persistent protocol which continues to sense the channel to try to seize it immediately upon detecting the end of previous transmission.

Lt Col Chandan Tiwari

Applies to slotted channels. Node senses channel. If idle, it transmits with probability p. With probability (1-p) it defers till next slot. If that slot is also idle, it either transmits or defers with probability p and (1-p) respectively. The process continues till either the frame has been transmitted or another stn has started transmitting. In latter case, stn waits for random time and starts same algorithm again.

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Comparison of the channel utilization versus load for various random access protocols.
Lt Col Chandan Tiwari

Stations abort transmission on detecting collision as opposed to continuing to send out data that will be lost anyway. In CSMA, each collision wastes at least one complete frame time, because both stations transmit their complete frames even though they are garbled the instant they collide. Terminating the transmission on detecting collision saves both time and bandwidth.

The transmitting stns will then wait a random amount of time and try again.
Used in Ethernet LAN.
Lt Col Chandan Tiwari

Collision detection can take as long as 2. A stn cannot be sure that it has seized the channel until it has transmitted for 2 without hearing a collision Lt Col Chandan Tiwari

802.1: This standard gives an introduction to the set of standards 802.2: This standard describes the upper part of the DLL, which uses Logical Link Control Protocol.
802.3: Describes the LAN Standard for Ethernet 802.4: Describes the LAN Standard Token Bus 802.5: Describes the LAN Standard Token Ring 802.6: Describes the LAN Standard Distributed Queue Dual Bus (DQDB) 802.11: Wireless LAN 802.15: Bluetooth 802.16: Wireless MAN

Each standard covers the physical layer and MAC sublayer protocol

Lt Col Chandan Tiwari

Ethernet refers to cable (the ether) dominant wired LAN technology first widely used LAN technology Simpler, cheap Kept up with speed race: 10 Mbps 10 Gbps

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

(a) Binary encoding, (b) Manchester encoding, (c) Differential Manchester encoding.
Lt Col Chandan Tiwari

In Mac Layer no reliable comn provided for. All that these protocols offer is best effort datagram service. This is adequate for some services but not for others. There may be systems in which error and flow controlled DLL is required Therefore LLC is: Forms upper half of Data Link Layer. Runs on top of the 802 protocols. Hides the differences of various 802 networks. Provides a single format and interface to the NW layer. NW layer passes packet to LLC. LLC sublayer adds LLC header containing seq and ack nos.

Lt Col Chandan Tiwari

Network layer
LLC LLC

PKT

PKT

MAC

MAC LLC

PKT

MAC

Physical layer

Lt Col Chandan Tiwari

Resulting structure inserted into a 802.X payload and transmitted.


LLC provides three service options: unreliable datagram service, acknowledged datagram service, and reliable connection-oriented service. The LLC header contains three fields: a destination access point, a source access point, and a control field. The access points tell which process the frame came from and where it is to be delivered. The control field contains sequence and acknowledgement numbers. These fields are primarily used when a reliable connection is needed at the data link level. For the Internet, best-efforts attempts to deliver IP packets is sufficient, so no acknowledgements at the LLC level are required
Lt Col Chandan Tiwari

WIRELESS 802.11

Lt Col Chandan Tiwari

Modes of operation
Point Coordination Function (PCF) - In the presence of a base station all communication must go through the base station, called an access point Distribution Coordination Function(DCF) - In the absence of a base station the computers would just send to one another directly. This mode is now sometimes called adhoc networking

Lt Col Chandan Tiwari

Infrastructure

Adhoc

Lt Col Chandan Tiwari

IEEE 802.11 Protocol Stack

Lt Col Chandan Tiwari

IEEE 802.11 Physical Layer


802.11b 802.11a
5 GHz range up to 54 Mbps OFDM(Orthogonal Frequency Division Multiplexing) in Physical Layer

2.4 GHz unlicensed radio spectrum up to 11 Mbps direct sequence spread spectrum (DSSS) in 802.11g physical layer 2.4 GHz range Range is 7 times greater up to 54 Mbps than 802.11a OFDM in Physical Layer

Lt Col Chandan Tiwari

With Ethernet, a station just waits until the ether goes silent and starts transmitting. If it does not receive a noise burst back within the first 64 bytes, the frame has almost assuredly been delivered correctly. With wireless, this situation does not hold. Hidden Stn Problem- Since not all stations are within radio range of each other, transmissions going on in one part of a cell may not be received elsewhere in the same cell.

Lt Col Chandan Tiwari

Exposed station problem - Here B wants to send to C so it listens to the channel. When it hears a transmission, it falsely concludes that it may not send to C, even though A may be transmitting to D (not shown). In addition, most radios are half duplex, meaning that they cannot transmit and listen for noise bursts at the same time on a single frequency. As a result of these problems, 802.11 does not use CSMA/CD, as Ethernet does.
Lt Col Chandan Tiwari

Hidden Station Problem

Exposed Station Problem

Lt Col Chandan Tiwari

A protocol called CSMA/CA (CSMA with Collision Avoidance) is used. In this protocol, both physical channel sensing and virtual channel sensing are used. Two methods of operation are supported by CSMA/CA. In the first method, when a station wants to transmit, it senses the channel. If it is idle, it just starts transmitting. It does not sense the channel while transmitting but emits its entire frame, which may well be destroyed at the receiver due to interference there. If the channel is busy, the sender defers until it goes idle and then starts transmitting. If a collision occurs, the colliding stations wait a random time, using the Ethernet binary exponential backoff algorithm, and then try again later.

Lt Col Chandan Tiwari

The other mode of CSMA/CA operation is based on MACAW and uses virtual channel sensing. In this example, A wants to send to B. C is a station within range of A (and possibly within range of B, but that does not matter). D is a station within range of B but not within range of A. The protocol starts when A decides it wants to send data to B. It begins by sending an RTS frame to B to request permission to send it a frame. When B receives this request, it may decide to grant permission, in which case it sends a CTS frame back. Upon receipt of the CTS, A now sends its frame and starts an ACK timer.

Lt Col Chandan Tiwari

Upon correct receipt of the data frame, B responds with an ACK frame, terminating the exchange. If A's ACK timer expires before the ACK gets back to it, the whole protocol is run again. C is within range of A, so it may receive the RTS frame. If it does, it realizes that someone is going to send data soon, so for the good of all it desists from transmitting anything until the exchange is completed. From the information provided in the RTS request, it can estimate how long the sequence will take, including the final ACK, so it asserts a kind of virtual channel busy for itself, indicated by NAV (Network Allocation Vector). D does not hear the RTS, but it does hear the CTS, so it also asserts the NAV signal for itself.

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

In contrast to wired networks, wireless networks are noisy and unreliable To deal with the problem of noisy channels, 802.11 allows frames to be fragmented into smaller pieces, each with its own checksum The fragments are individually numbered and acknowledged using a stop-and-wait protocol (i.e., the sender may not transmit fragment k + 1 until it has received the acknowledgment for fragment k). Once the channel has been acquired using RTS and CTS, multiple fragments can be sent in a row, (fragment burst)

Lt Col Chandan Tiwari

The base station polls the other stations, asking them if they have any frames to send. Since transmission order is completely controlled by the base station in PCF mode, no collisions ever occur. The basic mechanism is for the base station to broadcast a beacon frame periodically (10 to 100 times per second). The beacon frame contains system parameters, such as hopping sequences and dwell times (for FHSS), clock synchronization, etc. It also invites new stations to sign up for polling service. Once a station has signed up for polling service at a certain rate, it is effectively guaranteed a certain fraction of the bandwidth, thus making it possible to give quality-of-service guarantees.
Lt Col Chandan Tiwari

802.11 Frame Format


Bytes 2 2 6 6 6 2 6 0 - 2312
payload

4
CRC

frame address address address duration control 1 2 3

address seq 4 control

Bits

2
Protocol version

2
Type

4
Subtype

1
To AP

1
From AP

1
More frag

1
Retry

1
WEP

1
Rsvd

Power More mgt data

Lt Col Chandan Tiwari

Frame Control Protocol version allows two versions of the protocol to operate at the same time in the same cell. Type (data, control, or management) and Subtype fields (e.g., RTS or CTS). To DS and From DS bits indicate the frame is going to or coming from the intercell distribution system (e.g., Ethernet). MF bit means that more fragments will follow. Retry bit marks a retransmission of a frame sent earlier. Power management bit is used by the base station to put the receiver into sleep state or take it out of sleep state. More bit indicates that the sender has additional frames for the receiver. W bit specifies that the frame body has been encrypted using the WEP (Wired Equivalent Privacy) algorithm. O bit tells the receiver that a sequence of frames with this bit Lt Col Chandan Tiwari on must be processed strictly in order.

Duration field tells how long the frame and its acknowledgement will occupy the channel. This field is also present in the control frames and is how other stations manage the NAV mechanism. The frame header contains four addresses. The source and destination are obviously needed. The other two addresses are used for the source and destination base stations for intercell traffic. Sequence field allows fragments to be numbered. Of the 16 bits available, 12 identify the frame and 4 identify the fragment. Data field contains the payload, up to 2312 bytes Checksum Management frames have a format similar to that of data frames, except without one of the base station addresses because management frames are restricted to a single cell. Control frames are shorter still, having only one or two addresses, no Data field, and no Sequence field. The key information here is in the Lt Subtype field, usually RTS, CTS, or ACK. Col Chandan Tiwari

802.11 Frame:Addressing
H1 R1 router Internet

AP

R1 MAC addr AP MAC addr


dest. address source address

802.3 frame AP MAC addr H1 MAC addr R1 MAC addr


address 1 address 2 address 3

802.11 frame
Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Link Layer
3.1 Introduction and

services 3.2 Error detection and correction 3.3Multiple access protocols 3.4 Link layer addressing 3.5 Ethernet

3.6 Hubs and switches

3.7 PPP

Lt Col Chandan Tiwari

5: DataLink Layer 5-225

Link Layer: Introduction


Some terminology:
hosts and routers are nodes

link

communication channels that

connect adjacent nodes along communication path are links


wired links wireless links LANs

layer-2 packet is a frame,

encapsulates datagram

data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
Lt Col Chandan Tiwari 5: DataLink Layer 5-226

Link layer: context


Datagram transferred by

transportation analogy
trip from Princeton to

different link protocols over different links:

e.g., Ethernet on first link, frame relay on intermediate links, 802.11 on last link

Lausanne limo: Princeton to JFK plane: JFK to Geneva train: Geneva to Lausanne

Each link protocol

tourist = datagram transport segment =

provides different services

e.g., may or may not provide rdt over link

communication link transportation mode = link layer protocol travel agent = routing algorithm
Lt Col Chandan Tiwari 5: DataLink Layer 5-227

Link Layer Services


Framing, link access:

encapsulate datagram into frame, adding header, trailer channel access if shared medium MAC addresses used in frame headers to identify source, dest different from IP address!

Reliable delivery between adjacent nodes we will study this separately in detail seldom used on low bit error link (fiber, some twisted pair) wireless links: high error rates

Lt Col Chandan Tiwari

5: DataLink Layer 5-228

Link Layer Services (more)

Flow Control:

pacing between adjacent sending and receiving nodes important if large propagation delays
errors caused by signal attenuation, noise. receiver detects presence of errors: signals sender for retransmission or drops frame

Error Detection:

Error Correction:

Half-duplex and full-duplex

receiver identifies and corrects bit error(s) without resorting to retransmission


with half duplex, nodes at both ends of link can transmit, 5: DataLink Layer but not at same time Lt Col Chandan Tiwari

5-229

Adaptors Communicating
datagram sending node frame adapter link layer protocol frame adapter rcving node

link layer implemented in

adaptor (aka NIC)

Ethernet card, PCMCI card, 802.11 card

sending side: encapsulates datagram in a frame adds error checking bits, rdt, flow control, etc.

receiving side looks for errors, rdt, flow control, etc extracts datagram, passes to rcving node adapter is semi-

autonomous link & physical layers


5: DataLink Layer 5-230

Lt Col Chandan Tiwari

Part 3: Link Layer


3.1 Introduction and

services 3.2 Error detection and correction 3.3Multiple access protocols 3.4 Link layer addressing 3.5 Ethernet

3.6 Hubs and switches

3.7 PPP

Lt Col Chandan Tiwari

5: DataLink Layer 5-231

Error Detection
EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields

Error detection not 100% reliable! protocol may miss some errors, but rarely larger EDC field yields better detection and correction

Lt Col Chandan Tiwari

5: DataLink Layer 5-232

Parity Checking
Single Bit Parity:
Detect single bit errors

Two Dimensional Bit Parity:


Detect and correct single bit errors

Lt Col Chandan Tiwari

5: DataLink Layer 5-233

Internet checksum
Goal: detect errors (e.g., flipped bits) in transmitted segment (note: used at transport layer only) Sender:
treat segment contents

Receiver:
compute checksum of received

as sequence of 16-bit integers checksum: addition (1s complement sum) of segment contents sender puts checksum value into UDP checksum field

segment check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But

maybe errors nonetheless?

Lt Col Chandan Tiwari

5: DataLink Layer 5-234

Cyclic Redundancy Check


view data bits, D, as a binary number choose r+1 bit pattern (generator), G goal: choose r CRC bits, R, such that

<D,R> exactly divisible by G (modulo 2) receiver knows G, divides <D,R> by G. If non-zero remainder: error detected! can detect all burst errors less than r+1 bits

widely used in practice (ATM, HDLC)

Lt Col Chandan Tiwari

5: DataLink Layer 5-235

CRC Example
Want:

D.2r XOR R = nG
equivalently:

D.2r = nG XOR R
equivalently:
if we divide D.2r by G, want remainder R D.2r G

R = remainder[

Lt Col Chandan Tiwari

5: DataLink Layer 5-236

Part 3: Link Layer


3.1 Introduction and

services 3.2 Error detection and correction 3.3Multiple access protocols 3.4 Link layer addressing 3.5 Ethernet

3.6 Hubs and switches

3.7 PPP

Lt Col Chandan Tiwari

5: DataLink Layer 5-237

Multiple Access Links and Protocols


Two types of links:
point-to-point PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) Old-fashioned Ethernet upstream HFC 802.11 wireless LAN

Lt Col Chandan Tiwari

5: DataLink Layer 5-238

Multiple Access protocols


single shared broadcast channel

two or more simultaneous transmissions by nodes:

interference

multiple access protocol

collision if node receives two or more signals at the same time

distributed algorithm that determines how nodes share

channel, i.e., determine when node can transmit communication about channel sharing must use channel itself!

no out-of-band channel for coordination

Lt Col Chandan Tiwari

5: DataLink Layer 5-239

802.3 MAC Sub Layer Protocol


Bytes 7 Preamble 1 2/ 6 S Destination O Address F 2/ 6 Source Address 2 Length 0-1500 Data 0-46 4 Checksum Pad

Preamble of 7 bytes each with bit pattern 10101010 Manchester Encoding of this pattern produces 10 MHz square wave for 5.6 sec to allow the receiver clock to synchronise with the senders. 1 byte Start of Frame 10101011 delimiter 6 byte source and destination addresses. Length indicates number of bytes in data field. Pad field ensures min frame size is 64 bytes (less Preamble+SOF) Checksum field 32 bit CRC

48 bit address field provide a unique MAC address Higher order bit(47th bit) 0 for ordinary addresses and 1 for group/multicast address. 46th bit to distinguish between local and global address-2^(48-2). All bits are 1 for a broadcast address The MAC ADDRESS is burned into ROM on a network interface card
24 bits 24 bits

Vendor Code

Serial Number

00-90-F5 - 0C-99-6A
ROM Lt Col Chandan Tiwari RAM

Ideal Multiple Access Protocol


Broadcast channel of rate R bps 1. When one node wants to transmit, it can send at rate R. 2. When M nodes want to transmit, each can send at average rate R/M 3. Fully decentralized: No special node to coordinate transmissions 4. Simple

Lt Col Chandan Tiwari

5: DataLink Layer 5-242

MAC Protocols: a taxonomy


Three broad classes: Channel Partitioning

divide channel into smaller pieces (time slots, frequency, code) allocate piece to node for exclusive use

Random Access channel not divided, allow collisions recover from collisions Taking turns Nodes take turns, but nodes with more to send can take longer turns

Lt Col Chandan Tiwari

5: DataLink Layer 5-243

Channel Partitioning MAC protocols: TDMA


TDMA: time division multiple access
access to channel in "rounds" each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle

Lt Col Chandan Tiwari

5: DataLink Layer 5-244

Channel Partitioning MAC protocols: FDMA


FDMA: frequency division multiple access
channel spectrum divided into frequency bands

each station assigned fixed frequency band


unused transmission time in frequency bands go idle example: 6-station LAN, 1,3,4 have pkt, frequency

bands 2,5,6 idle

frequency bands
Lt Col Chandan Tiwari 5: DataLink Layer 5-245

Random Access Protocols


When node has packet to send transmit at full channel data rate R. no a priori coordination among nodes two or more transmitting nodes collision, random access MAC protocol specifies: how to detect collisions how to recover from collisions (e.g., via delayed retransmissions) Examples of random access MAC protocols: slotted ALOHA ALOHA CSMA, CSMA/CD, CSMA/CA
Lt Col Chandan Tiwari 5: DataLink Layer 5-246

Pure (unslotted) ALOHA


unslotted Aloha: simpler, no synchronization, no

carrier sensing. when frame first arrives

transmit immediately

collision probability increases: frame sent at t0 collides with other frames sent in [t0-1,t0+1]

Lt Col Chandan Tiwari

5: DataLink Layer 5-247

Pure Aloha efficiency


P(success by given node) = P(node transmits) . P(no other node transmits in [p0-1,p0] . P(no other node transmits in [p0-1,p0] = p . (1-p)N-1 . (1-p)N-1 = p . (1-p)2(N-1)
choosing optimum p and then letting n -> infty ... = 1/(2e) = .18

Lt Col Chandan Tiwari

5: DataLink Layer 5-248

Slotted ALOHA
Assumptions all frames same size time is divided into equal size slots, time to transmit 1 frame nodes start to transmit frames only at beginning of slots nodes are synchronized if 2 or more nodes transmit in slot, all nodes detect collision Operation when node obtains fresh frame, it transmits in next slot no collision, node can send new frame in next slot if collision, node retransmits frame in each subsequent slot with prob. p until success

Lt Col Chandan Tiwari

5: DataLink Layer 5-249

Slotted ALOHA

Pros single active node can continuously transmit at full rate of channel highly decentralized: only slots in nodes need to be in sync simple

Cons collisions, wasting slots idle slots nodes may be able to detect collision in less than time to transmit packet clock synchronization (used in a hub-spoke manner)
Lt Col Chandan Tiwari 5: DataLink Layer 5-250

Slotted Aloha efficiency


Efficiency is the long-run fraction of successful slots when there are many nodes, each with many frames to send
Suppose N nodes with For max efficiency

many frames to send, each transmits in slot with probability p prob that node 1 has success in a slot
= p(1-p)N-1

with N nodes, find p* that maximizes Np(1-p)N-1 For many nodes, take limit of Np*(1-p*)N-1 as N goes to infinity, gives 1/e = .37

At best: channel

prob that any node has a success = Np(1-p)N-1


Lt Col Chandan Tiwari

used for useful transmissions 37% of time!


5: DataLink Layer 5-251

CSMA (Carrier Sense Multiple Access)


CSMA: listen before transmit: If channel sensed idle: transmit entire frame If channel sensed busy, defer transmission
Human analogy: dont interrupt others!

Lt Col Chandan Tiwari

5: DataLink Layer 5-252

All frames must take more than 2t to send so that the txn is still taking place when the noise burst gets back to the sender, otherwise the sender will incorrectly conclude that the frame was successfully sent For 10Mbps LAN with max length of 2500m and 04 repeaters 2t=50 micro sec which corresponds to min frame size of 500 bits. With safety margin it is chosen to be 512 bits(64 bytes)

Lt Col Chandan Tiwari

Collisions are caused when two adaptors transmit at the same time (adaptors sense collision based on voltage differences)
Both found line to be idle Both had been waiting to for a busy line to become idle

A starts at time 0

Message almost there at time T when B starts collision!

How can we be sure A knows about the collision?


CS 640 254

How can A know that a collision has taken place?


There must be a mechanism to insure retransmission on collision As message reaches B at time T Bs message reaches A at time 2T So, A must still be transmitting at 2T

IEEE 802.3 specifies max value of 2T to be 51.2us


This relates to maximum distance of 2500m between hosts At 10Mbps it takes 0.1us to transmit one bit so 512 bits (64B) take 51.2us to send So, Ethernet frames must be at least 64B long
14B header, 46B data, 4B CRC Padding is used if data is less than 46B

Send jamming signal after collision is detected to insure all hosts see collision
48 bit signal
CS 640 255

time = 0

time = T

time = 2T

CS 640

256

Ethernet uses CSMA/CD protocol Nodes are required to wait for random time for retransmission after collision.

Need to have the randomization interval grow exponentially as more and more consecutive collisions take place.

Lt Col Chandan Tiwari

After collision, time divided into discrete time slots equal to worst case RTT. After first collision, each stn waits 0 or 1 slot times before trying again. After second collision, each stn waits for 0,1,2 or 3 slot times before trying again.

After i collisions, a random number between 0 and 2i 1 is chosen.


Lt Col Chandan Tiwari

After 10 collisions, randomization interval frozen at 1023. Nodes give up after 16 collisions. Left to upper layers to resolve the issue

The algorithm ensures


low delay when few nodes collide. collision is resolved in a reasonable interval when many nodes collide.
Lt Col Chandan Tiwari

CSMA collisions
collisions can still occur:
propagation delay means two nodes may not hear each others transmission

spatial layout of nodes

collision:
entire packet transmission time wasted

note:
role of distance & propagation delay in determining collision probability

Lt Col Chandan Tiwari

5: DataLink Layer 5-260

CSMA/CD (Collision Detection)


CSMA/CD: carrier sensing, deferral as in CSMA
collisions
colliding

detected within short time

wastage

transmissions aborted, reducing channel

collision detection:
easy

in wired LANs: measure signal strengths, compare transmitted, received signals difficult in wireless LANs: receiver shut off while transmitting
human analogy: the polite conversationalist
Lt Col Chandan Tiwari 5: DataLink Layer 5-261

CSMA/CD collision detection

Lt Col Chandan Tiwari

5: DataLink Layer 5-262

Taking Turns MAC protocols


channel partitioning MAC protocols: share channel efficiently and fairly at high load inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node! Random access MAC protocols efficient at low load: single node can fully utilize channel high load: collision overhead taking turns protocols

look for best of both worlds!


Lt Col Chandan Tiwari 5: DataLink Layer 5-263

Taking Turns MAC protocols


Polling: master node invites slave nodes to transmit in turn concerns:

Token passing: control token passed from one node to next sequentially. token message concerns:

polling overhead latency single point of failure (master)

token overhead latency single point of failure (token)

Lt Col Chandan Tiwari

5: DataLink Layer 5-264

Summary of MAC protocols


What do you do with a shared media?
Channel
Random

Partitioning, by time, frequency or code


partitioning (dynamic),

Time Division, Frequency Division ALOHA, S-ALOHA, CSMA, CSMA/CD carrier sensing: easy in some technologies (wire), hard in others (wireless) CSMA/CD used in Ethernet CSMA/CA used in 802.11
Taking

Turns

polling from a central site, token passing


Lt Col Chandan Tiwari 5: DataLink Layer 5-265

Part 3: Link Layer


3.1 Introduction and

services 3.2 Error detection and correction 3.3Multiple access protocols 3.4 Link layer addressing 3.5 Ethernet

3.6 Hubs and switches 3.7 PPP

Lt Col Chandan Tiwari

5: DataLink Layer 5-266

MAC Addresses and ARP


32-bit IP address:
network-layer

address used to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet)

address:
used

to get frame from one interface to another physically-connected interface (same network) 48 bit MAC address (for most LANs) burned in the adapter ROM
Lt Col Chandan Tiwari

5: DataLink Layer 5-267

LAN Addresses and ARP


Each adapter on LAN has unique LAN address

1A-2F-BB-76-09-AD

Broadcast address = FF-FF-FF-FF-FF-FF

71-65-F7-2B-08-53

LAN (wired or wireless)


58-23-D7-FA-20-B0

= adapter

0C-C4-11-6F-E3-98

Lt Col Chandan Tiwari

5: DataLink Layer 5-268

LAN Address (more)


MAC address allocation administered by IEEE

manufacturer buys portion of MAC address space

(to assure uniqueness) Analogy: (a) MAC address: like Social Security Number (b) IP address: like postal address MAC flat address portability

can move LAN card from one LAN to another

IP hierarchical address NOT portable depends on IP subnet to which node is attached

Lt Col Chandan Tiwari

5: DataLink Layer 5-269

ARP: Address Resolution Protocol


Question: how to determine MAC address of B knowing Bs IP address?
137.196.7.78 1A-2F-BB-76-09-AD 137.196.7.23 137.196.7.14

Each IP node (Host,

Router) on LAN has ARP table ARP Table: IP/MAC address mappings for some LAN nodes
< IP address; MAC address; TTL>

LAN
71-65-F7-2B-08-53 58-23-D7-FA-20-B0

TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min)

137.196.7.88

0C-C4-11-6F-E3-98

Lt Col Chandan Tiwari

5: DataLink Layer 5-270

ARP protocol: Same LAN (network)


A wants to send datagram

to B, and Bs MAC address not in As ARP table. A broadcasts ARP query packet, containing B's IP address Dest MAC address = FF-FF-FF-FF-FF-FF all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address

A caches (saves) IP-to-

MAC address pair in its ARP table until information becomes old (times out) soft state: information that times out (goes away) unless refreshed

frame sent to As MAC address (unicast)

ARP is plug-and-play: nodes create their ARP tables without intervention from net administrator

Lt Col Chandan Tiwari

5: DataLink Layer 5-271

DHCP: Dynamic Host Configuration Protocol


Goal: allow host to dynamically obtain its IP address from network server when it joins network
Can renew its lease on address in use Allows reuse of addresses (only hold address while connected an on Support for mobile users who want to join network (more shortly)

DHCP overview: host broadcasts DHCP discover msg DHCP server responds with DHCP offer msg host requests IP address: DHCP request msg DHCP server sends address: DHCP ack msg
Lt Col Chandan Tiwari 5: DataLink Layer 5-272

DHCP client-server scenario


A

223.1.1.1 223.1.1.2 223.1.1.4 223.1.1.3 223.1.3.1

DHCP server
223.1.2.9

223.1.2.1

223.1.2.2
223.1.3.27 223.1.3.2

arriving DHCP client needs address in this network

Lt Col Chandan Tiwari

5: DataLink Layer 5-273

DHCP client-server scenario


DHCP server: 223.1.2.5
DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 Lifetime: 3600 secs

arriving client

DHCP request
src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs Lt Col Chandan Tiwari 5: DataLink Layer 5-274

time

Routing to another LAN


walkthrough: send datagram from A to B via R assume A knows B IP address

R
Two ARP tables in router R, one for each IP

network (LAN). R works as a gateway into another Lt Col Chandan Tiwari 5: DataLink Layer network

5-275

A creates datagram with source A, destination B A uses ARP to get Rs MAC address for 111.111.111.110 A creates link-layer frame with R's MAC address as dest,

frame contains A-to-B IP datagram As adapter sends frame Rs adapter receives frame R removes IP datagram from Ethernet frame, sees its destined to B R uses ARP to get Bs MAC address R creates frame containing A-to-B IP datagram sends to B

A
R
Lt Col Chandan Tiwari

B
5: DataLink Layer 5-276

Part 3: Link Layer


3.1 Introduction and

services 3.2 Error detection and correction 3.3Multiple access protocols 3.4 Link layer addressing 3.5 Ethernet

3.6 Hubs and switches

3.7 PPP

Lt Col Chandan Tiwari

5: DataLink Layer 5-277

Ethernet
dominant wired LAN technology: cheap $20 for 100Mbs! first widely used LAN technology Simpler, cheaper than token LANs and ATM Kept up with speed race: 10 Mbps 10 Gbps

Metcalfes Ethernet sketch

Lt Col Chandan Tiwari

5: DataLink Layer 5-278

Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices: hub or switch (more later)

hub or switch

Lt Col Chandan Tiwari

5: DataLink Layer 5-279

Ethernet Frame Structure


Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Preamble: 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 used to synchronize receiver, sender clock rates

Lt Col Chandan Tiwari

5: DataLink Layer 5-280

Ethernet Frame Structure (more)


Addresses: 6 bytes if adapter receives frame with matching destination address, or with broadcast address (eg ARP packet), it passes data in frame to net-layer protocol otherwise, adapter discards frame Type: indicates the higher layer protocol (mostly

IP but others may be supported such as Novell IPX and AppleTalk) CRC: checked at receiver, if error is detected, the frame is simply dropped

Lt Col Chandan Tiwari

5: DataLink Layer 5-281

Unreliable, connectionless service


Connectionless: No handshaking between sending

and receiving adapter. Unreliable: receiving adapter doesnt send acks or nacks to sending adapter

stream of datagrams passed to network layer can have gaps gaps will be filled if app is using TCP otherwise, app will see the gaps

Lt Col Chandan Tiwari

5: DataLink Layer 5-282

Ethernet uses CSMA/CD


No slots Before attempting a

adapter doesnt transmit

if it senses that some other adapter is transmitting, that is, carrier sense transmitting adapter aborts when it senses that another adapter is transmitting, that is, collision detection

retransmission, adapter waits a random time, that is, random access Minimum Ethernet frame size related to the physical size of the network

Lt Col Chandan Tiwari

5: DataLink Layer 5-283

Ethernet CSMA/CD algorithm


1. Adaptor receives 4. If adapter detects datagram from net layer & another transmission while creates frame transmitting, aborts and 2. If adapter senses channel sends 48 bit jam signal idle (96 bit times), it starts 5. After aborting, adapter to transmit frame. If it enters exponential backoff: senses channel busy, waits after the mth collision, until channel idle and then adapter chooses a K at transmits random from {0,1,2,,2m-1}. Adapter waits 3. If adapter transmits K512 bit times and returns entire frame without to Step 2 detecting another transmission, the adapter is done with frame ! Lt Col Chandan Tiwari 5: DataLink Layer 5-284

Ethernets CSMA/CD (more)


Jam Signal: make sure all Exponential Backoff: other transmitters are aware Goal: adapt retransmission of collision; 48 bits attempts to estimated Bit time: .1 microsec for 10 current load Mbps Ethernet ; heavy load: random wait for K=1023, wait time is about will be longer 50 msec first collision: choose K from {0,1}; delay is K 512 bit transmission times after second collision: choose K from {0,1,2,3} after ten collisions, choose K from {0,1,2,3,4,,1023}

Lt Col Chandan Tiwari

5: DataLink Layer 5-285

CSMA/CD efficiency
Tprop = max prop between 2 nodes in LAN

ttrans = time to transmit max-size frame

efficiency

1 1 5t pr op / ttr ans

Efficiency goes to 1 as tprop goes to 0 Goes to 1 as ttrans goes to infinity

Much better than ALOHA, but still decentralized,

simple, and cheap

Lt Col Chandan Tiwari

5: DataLink Layer 5-286

Manchester encoding

Used in 10BaseT Each bit has a transition Allows clocks in sending and receiving nodes to

synchronize to each other

no need for a centralized, global clock among nodes!


Lt Col Chandan Tiwari 5: DataLink Layer 5-287

Hey, this is physical-layer stuff!

Chapter 4 Network Layer

Lt Col Chandan Tiwari

Part 5: Network Layer


5. 1 Introduction 5.2 Datagram networks 5.3 Whats inside a router 5.4 IP: Internet Protocol
Datagram format IPv4 addressing ICMP IPv6

5.5 Routing algorithms


Link state Distance Vector Hierarchical routing

5.6 Routing in the Internet


RIP OSPF BGP

5.7 Broadcast and multicast routing

Lt Col Chandan Tiwari

Network layer

transport segment from sending to receiving host on sending side encapsulates segments into datagrams on rcving side, delivers segments to transport layer network layer protocols in every host, router Router examines header fields in all IP datagrams passing through it

application transport network data link physical

network data link physical

network data link physical network data link physical

network data link physical

network data link physical

network data link physical

network data link physical


network data link physical application transport network data link physical

Lt Col Chandan Tiwari

forwarding: move packets from routers input to appropriate router output routing: determine route taken by packets from source to dest.
routing algorithms

Lt Col Chandan Tiwari

Interplay between routing and forwarding


routing algorithm

local forwarding table header value output link


0100 0101 0111 1001 3 2 2 1

value in arriving packets header


0111

1
3 2

Lt Col Chandan Tiwari

Part 5: Network Layer


5. 1 Introduction 5.2 Datagram networks 5.3 Whats inside a router 5.4 IP: Internet Protocol
Datagram format IPv4 addressing ICMP IPv6

5.5 Routing algorithms


Link state Distance Vector Hierarchical routing

5.6 Routing in the Internet


RIP OSPF BGP

5.7 Broadcast and multicast routing

Lt Col Chandan Tiwari

datagram network provides network-layer connectionless service analogous to the transport-layer services, but:
service: host-to-host implementation: in network core

Lt Col Chandan Tiwari

Datagram networks
routers: no state about end-to-end connections
no network-level concept of connection

packets forwarded using destination host address


packets between same source-dest pair may take different paths

application transport network data link 1. Send data physical

application transport 2. Receive data network data link physical


Lt Col Chandan Tiwari

4 billion possible entries


Destination Address Range 11001000 00010111 00010000 00000000 through 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 11001000 00010111 00011111 11111111 Link Interface

otherwise
Lt Col Chandan Tiwari

Prefix Match 11001000 00010111 00010 11001000 00010111 00011000 11001000 00010111 00011 otherwise Examples

Link Interface 0 1 2 3

DA: 11001000 00010111 00010110 10100001 DA: 11001000 00010111 00011000 10101010

Which interface? Which interface?

Lt Col Chandan Tiwari

Part 5: Network Layer


5. 1 Introduction 5.2 Datagram networks 5.3 Whats inside a router 5.4 IP: Internet Protocol
Datagram format IPv4 addressing ICMP IPv6

5.5 Routing algorithms


Link state Distance Vector Hierarchical routing

5.6 Routing in the Internet


RIP OSPF BGP

5.7 Broadcast and multicast routing

Lt Col Chandan Tiwari

The Internet Network layer


Host, router network layer functions:
Transport layer: TCP, UDP
Routing protocols path selection RIP, OSPF, BGP IP protocol addressing conventions datagram format packet handling conventions

Network layer

forwarding table

ICMP protocol error reporting router signaling

Link layer physical layer

Lt Col Chandan Tiwari

Part 5: Network Layer


5. 1 Introduction 5.2 Datagram networks 5.3 Whats inside a router 5.4 IP: Internet Protocol
Datagram format IPv4 addressing ICMP IPv6

5.5 Routing algorithms


Link state Distance Vector Hierarchical routing

5.6 Routing in the Internet


RIP OSPF BGP

5.7 Broadcast and multicast routing

Lt Col Chandan Tiwari

IP protocol version number header length (bytes) type of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to

32 bits ver head. type of len service length

total datagram length (bytes)

fragment 16-bit identifier flgs offset upper time to header layer live checksum 32 bit source IP address 32 bit destination IP address Options (if any)

for fragmentation/ reassembly

how much overhead with TCP? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead

data (variable length, typically a TCP or UDP segment)


Lt Col Chandan Tiwari

E.g. timestamp, record route taken, specify list of routers to visit.

IP Fragmentation & Reassembly


network links have MTU (max.transfer size) - largest possible link-level frame. different link types, different MTUs large IP datagram divided (fragmented) within net one datagram becomes several datagrams reassembled only at final destination IP header bits used to identify, order related fragments

fragmentation: in: one large datagram out: 3 smaller datagrams

reassembly

Lt Col Chandan Tiwari

IP Fragmentation and Reassembly


Example 4000 byte datagram MTU = 1500 bytes
length ID fragflag offset =4000 =x =0 =0 One large datagram becomes several smaller datagrams length ID fragflag offset =1500 =x =1 =0 length ID fragflag offset =1500 =x =1 =185 length ID fragflag offset =1040 =x =0 =370

1480 bytes in data field offset = 1480/8

Lt Col Chandan Tiwari

Part 5: Network Layer


5. 1 Introduction 5.2 Datagram networks 5.3 Whats inside a router 5.4 IP: Internet Protocol
Datagram format IPv4 addressing ICMP IPv6

5.5 Routing algorithms


Link state Distance Vector Hierarchical routing

5.6 Routing in the Internet


RIP OSPF BGP

5.7 Broadcast and multicast routing

Lt Col Chandan Tiwari

IP Addressing: introduction
IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link
routers typically have multiple interfaces host typically has one interface IP addresses associated with each interface
223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.1.3 223.1.2.9

223.1.3.27

223.1.2.2

223.1.3.1

223.1.3.2

223.1.1.1 = 11011111 00000001 00000001 00000001 223


Lt Col Chandan Tiwari

Subnets
IP address:
subnet part (high order bits) host part (low order bits)
223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.1.3 223.1.2.9 223.1.2.2

Whats a subnet ?
device interfaces with same subnet part of IP address can physically reach each other without intervening router

223.1.3.27

subnet
223.1.3.1 223.1.3.2

network consisting of 3 subnets

Lt Col Chandan Tiwari

Subnets
Recipe To determine the subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet.

223.1.1.0/24

223.1.2.0/24

223.1.3.0/24

Subnet mask: /24

Lt Col Chandan Tiwari

Subnets
How many?
223.1.1.1

223.1.1.2

223.1.1.4 223.1.1.3

223.1.9.2

223.1.7.0

223.1.9.1 223.1.8.1 223.1.2.6 223.1.8.0

223.1.7.1

223.1.3.27 223.1.2.2 223.1.3.1 223.1.3.2

223.1.2.1

Lt Col Chandan Tiwari

CIDR: Classless InterDomain Routing


subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address

subnet part

host part

11001000 00010111 00010000 00000000


200.23.16.0/23
Lt Col Chandan Tiwari

Q: How does network get subnet part of IP addr? A: gets allocated portion of its provider ISPs address space
ISP's block Organization 0 Organization 1 Organization 2 ... Organization 7 11001000 00010111 00010000 00000000 11001000 00010111 00010000 00000000 11001000 00010111 00010010 00000000 11001000 00010111 00010100 00000000 .. . 11001000 00010111 00011110 00000000 200.23.16.0/20 200.23.16.0/23 200.23.18.0/23 200.23.20.0/23 . 200.23.30.0/23

Lt Col Chandan Tiwari

Q: How does host get IP address?


hard-coded by system admin in a file

/etc/network/interfaces
DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server

plug-and-play

Lt Col Chandan Tiwari

Hierarchical addressing allows efficient advertisement of routing information:


Organization 0

200.23.16.0/23
Organization 1

200.23.18.0/23 200.23.20.0/23

Organization 2

Organization 7

. . .

. . .

Fly-By-Night-ISP

Send me anything with addresses beginning 200.23.16.0/20 Internet

200.23.30.0/23
ISPs-R-Us Send me anything with addresses beginning 199.31.0.0/16

Lt Col Chandan Tiwari

ISPs-R-Us has a more specific route to Organization 1


Organization 0

200.23.16.0/23
Send me anything with addresses beginning 200.23.16.0/20 Internet

Organization 2

200.23.20.0/23

Organization 7

. . .

. . .

Fly-By-Night-ISP

200.23.30.0/23
ISPs-R-Us Organization 1 Send me anything with addresses beginning 199.31.0.0/16 or 200.23.18.0/23

200.23.18.0/23

Lt Col Chandan Tiwari

Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned
Names and Numbers

allocates addresses manages DNS assigns domain names, resolves disputes

Lt Col Chandan Tiwari

rest of Internet

local network (e.g., home network) 10.0.0/24


10.0.0.4

10.0.0.1 10.0.0.2

138.76.29.7 10.0.0.3

network have same single source NAT IP address: 138.76.29.7, different source port numbers

All datagrams leaving local

Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual)

Lt Col Chandan Tiwari

Motivation: local network uses just one IP address as far as outside world is concerned:

range of addresses not needed from ISP: just one IP address for all devices can change addresses of devices in local network without notifying outside world can change ISP without changing addresses of devices in local network devices inside local net not explicitly addressable, visible by outside world (a security plus).
Lt Col Chandan Tiwari

Implementation: NAT router must:

outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #)
. . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr.

remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table
Lt Col Chandan Tiwari

NAT: Network Address Translation


2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table NAT translation table WAN side addr LAN side addr

138.76.29.7, 5001 10.0.0.1, 3345

1: host 10.0.0.1 sends datagram to 128.119.40.186, 80

S: 10.0.0.1, 3345 D: 128.119.40.186, 80

S: 138.76.29.7, 5001 D: 128.119.40.186, 80

1
10.0.0.4
S: 128.119.40.186, 80 D: 10.0.0.1, 3345

10.0.0.1
10.0.0.2

138.76.29.7

3: Reply arrives dest. address: 138.76.29.7, 5001

S: 128.119.40.186, 80 D: 138.76.29.7, 5001

10.0.0.3 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345
Lt Col Chandan Tiwari

16-bit port-number field:


60,000 simultaneous connections with a single LANside address!

NAT is controversial:
routers should only process up to layer 3 violates end-to-end argument
NAT possibility must be taken into account by app designers, eg, P2P applications

address shortage should instead be solved by IPv6


Lt Col Chandan Tiwari

Part 5: Network Layer


5. 1 Introduction 5.2 Datagram networks 5.3 Whats inside a router 5.4 IP: Internet Protocol
Datagram format IPv4 addressing ICMP IPv6

5.5 Routing algorithms


Link state Distance Vector Hierarchical routing

5.6 Routing in the Internet


RIP OSPF BGP

5.7 Broadcast and multicast routing

Lt Col Chandan Tiwari

ICMP: Internet Control Message Protocol


used by hosts & routers to communicate network-level information error reporting: unreachable host, network, port, protocol echo request/reply (used by ping) network-layer above IP: ICMP msgs carried in IP datagrams ICMP message: type, code plus first 8 bytes of IP datagram causing error Type 0 3 3 3 3 3 3 4 8 9 10 11 12 Code 0 0 1 2 3 6 7 0 0 0 0 0 0 description echo reply (ping) dest. network unreachable dest host unreachable dest protocol unreachable dest port unreachable dest network unknown dest host unknown source quench (congestion control - not used) echo request (ping) route advertisement router discovery TTL expired bad IP header

Lt Col Chandan Tiwari

Traceroute and ICMP


Source sends series of UDP segments to dest
First has TTL =1 Second has TTL=2, etc. Unlikely port number

When nth datagram arrives to nth router:


Router discards datagram And sends to source an ICMP message (type 11, code 0) Message includes name of router& IP address

When ICMP message arrives, source calculates RTT Traceroute does this 3 times Stopping criterion UDP segment eventually arrives at destination host Destination returns ICMP host unreachable packet (type 3, code 3) When source gets this ICMP, stops.

Lt Col Chandan Tiwari

Part 5: Network Layer


5. 1 Introduction 5.2 Datagram networks 5.3 Whats inside a router 5.4 IP: Internet Protocol
Datagram format IPv4 addressing ICMP IPv6

5.5 Routing algorithms


Link state Distance Vector Hierarchical routing

5.6 Routing in the Internet


RIP OSPF BGP

5.7 Broadcast and multicast routing

Lt Col Chandan Tiwari

Initial motivation: 32-bit address space soon to be completely allocated. Additional motivation:
header format helps speed processing/forwarding header changes to facilitate QoS IPv6 datagram format: fixed-length 40 byte header no fragmentation allowed

Lt Col Chandan Tiwari

Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same flow. (concept offlow not well defined). Next header: identify upper layer protocol for data

Lt Col Chandan Tiwari

Checksum: removed entirely to reduce processing time at each hop Options: allowed, but outside of header, indicated by Next Header field ICMPv6: new version of ICMP
additional message types, e.g. Packet Too Big multicast group management functions

Lt Col Chandan Tiwari

Not all routers can be upgraded simultaneous


no flag days How will the network operate with mixed IPv4 and IPv6 routers?

Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers

Lt Col Chandan Tiwari

Logical view:

A
IPv6

B
IPv6

tunnel

E
IPv6

F
IPv6

Physical view:

A
IPv6

B
IPv6
IPv4 IPv4

E
IPv6

F
IPv6

Lt Col Chandan Tiwari

Logical view:

A
IPv6

B
IPv6

tunnel

E
IPv6

F
IPv6

Physical view:

A
IPv6
Flow: X Src: A Dest: F data

B
IPv6

C
IPv4

D
IPv4

E
IPv6

F
IPv6

Src:B Dest: E
Flow: X Src: A Dest: F data

Src:B Dest: E
Flow: X Src: A Dest: F data

Flow: X Src: A Dest: F data

A-to-B: IPv6

B-to-C: IPv6 inside IPv4

Lt Col Chandan Tiwari

B-to-C: IPv6 inside IPv4

E-to-F: IPv6

Part 5: Network Layer


5. 1 Introduction 5.2 Datagram networks 5.3 Whats inside a router 5.4 IP: Internet Protocol
Datagram format IPv4 addressing ICMP IPv6

5.5 Routing algorithms


Link state Distance Vector Hierarchical routing

5.6 Routing in the Internet


RIP OSPF BGP

5.7 Broadcast and multicast routing

Lt Col Chandan Tiwari

routing algorithm

local forwarding table header value output link


0100 0101 0111 1001 3 2 2 1

value in arriving packets header


0111

1
3 2

Lt Col Chandan Tiwari

5
2 1 Graph: G = (N,E)

v
2

3 3 1

w
1

z
2

N = set of routers = { u, v, w, x, y, z }

E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Remark: Graph abstraction is useful in other network contexts Example: P2P, where N is set of peers and E is set of TCP connections
Lt Col Chandan Tiwari

5 2 1

v
2

c(x,x) = cost of link (x,x)

w
3
1

- e.g., c(w,z) = 5

z
2

cost could always be 1, or inversely related to bandwidth, or inversely related to congestion

Cost of path (x1, x2, x3,, xp) = c(x1,x2) + c(x2,x3) + + c(xp-1,xp)


Question: Whats the least-cost path between u and z ?

Routing algorithm: algorithm that finds least-cost path


Lt Col Chandan Tiwari

Routing Algorithm classification


Global or decentralized information?
Global: all routers have complete topology, link cost info link state algorithms Decentralized: router knows physicallyconnected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors distance vector algorithms

Static or dynamic?
Static: routes change slowly over time Dynamic: routes change more quickly periodic update in response to link cost changes

Lt Col Chandan Tiwari

Part 5: Network Layer


5. 1 Introduction 5.2 Datagram networks 5.3 Whats inside a router 5.4 IP: Internet Protocol
Datagram format IPv4 addressing ICMP IPv6

5.5 Routing algorithms


Link state Distance Vector Hierarchical routing

5.6 Routing in the Internet


RIP OSPF BGP

5.7 Broadcast and multicast routing

Lt Col Chandan Tiwari

A Link-State Routing Algorithm


Dijkstras algorithm
net topology, link costs known to all nodes accomplished via link state broadcast all nodes have same info computes least cost paths from one node (source) to all other nodes gives forwarding table for that node iterative: after k iterations, know least cost path to k dest.s

Notation: c(x,y): link cost from node x to


y; = if not direct neighbors

D(v): current value of cost of


path from source to dest. v

p(v): predecessor node along


path from source to v

N': set of nodes whose least cost


path definitively known

Lt Col Chandan Tiwari

1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = 7 8 Loop 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N'
Lt Col Chandan Tiwari

Step 0 1 2 3 4 5

N' u ux uxy uxyv uxyvw uxyvwz

D(v),p(v) D(w),p(w) 2,u 5,u 2,u 4,x 2,u 3,y 3,y

D(x),p(x) 1,u

D(y),p(y) 2,x

D(z),p(z)

4,y 4,y 4,y

5 2 1

v
2

3 3 1

w
1

z
2

Lt Col Chandan Tiwari

Resulting shortest-path tree from u:

v u

z x
y

Resulting forwarding table in u: destination v x y w z link (u,v) (u,x) (u,x) (u,x) (u,x)
Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Dijkstras algorithm, discussion


Algorithm complexity: n nodes each iteration: need to check all nodes, w, not in N n(n+1)/2 comparisons: O(n2) more efficient implementations possible: O(nlogn) Oscillations possible: e.g., link cost = amount of carried traffic
D
1 1 0

A
0 0

1+e e

B
1

2+e

C
e

D 1+e 1 B 0 0 C recompute routing

0 1

A
0 0

2+e

1+e

2+e

D 1+e 1 B e 0 C

initially

recompute

recompute

Lt Col Chandan Tiwari

Part 5: Network Layer


5. 1 Introduction 5.2 Datagram networks 5.3 Whats inside a router 5.4 IP: Internet Protocol
Datagram format IPv4 addressing ICMP IPv6

5.5 Routing algorithms


Link state Distance Vector Hierarchical routing

5.6 Routing in the Internet


RIP OSPF BGP

5.7 Broadcast and multicast routing

Lt Col Chandan Tiwari

Bellman-Ford Equation (dynamic programming) Define dx(y) := cost of least-cost path from x to y

Then
dx(y) = min {c(x,v) + dv(y) }
v

where min is taken over all neighbors v of x


Lt Col Chandan Tiwari

5 2 1

v
2

3 3 1

w
1

Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3


z

B-F equation says:


du(z) = min { c(u,v) + dv(z), c(u,x) + dx(z), c(u,w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4

Node that achieves minimum is next hop in shortest path forwarding table
Lt Col Chandan Tiwari

Dx(y) = estimate of least cost from x to y Node x knows cost to each neighbor v: c(x,v) Node x maintains distance vector Dx = [Dx(y): yN] Node x also maintains its neighbors distance vectors
For each neighbor v, x maintains Dv = [Dv(y): y N ]
Lt Col Chandan Tiwari

Basic idea: Each node periodically sends its own distance vector estimate to neighbors When a node x receives new DV estimate from neighbor, it updates its own DV using B-F equation: Dx(y) minv{c(x,v) + Dv(y)} for each node y N
r The estimate Dx(y) converges to the actual least cost dx(y)

Lt Col Chandan Tiwari

Distance Vector Algorithm


Iterative, asynchronous: each
local iteration caused by: local link cost change DV update message from neighbor

Each node: wait for (change in local link


cost or msg from neighbor)

Distributed:
each node notifies neighbors only when its DV changes
neighbors then notify their neighbors if necessary

recompute estimates
if DV to any dest has changed, notify neighbors

Lt Col Chandan Tiwari

Link cost changes:


r r r

node detects local link cost change updates routing info, recalculates distance vector if DV changes, notify neighbors

y
50

good news travels fast

At time t0, y detects the link-cost change, updates its DV, and informs its neighbors. At time t1, z receives the update from y and updates its table. It computes a new least cost to x and sends its neighbors its DV. At time t2, y receives zs update and updates its distance table. ys least costs do not change and hence y does not send any message to z.

Lt Col Chandan Tiwari

Link cost changes:


r r r

good news travels fast bad news travels slow - count to infinity problem! 44 iterations before algorithm stabilizes: see text

60

y
50

Poisoned reverse:
r

If Z routes through Y to get to X :


m

Z tells Y its (Zs) distance to X is infinite (so Y wont route to X via Z)

Lt Col Chandan Tiwari

Comparison of LS and DV algorithms


Message complexity
LS: with n nodes, E links, O(nE) msgs sent DV: exchange between neighbors only convergence time varies

Robustness: what happens if router malfunctions? LS:


node can advertise incorrect link cost each node computes only its own table

Speed of Convergence
LS: O(n2) algorithm requires O(nE) msgs may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem

DV:
DV node can advertise incorrect path cost each nodes table used by others
error propagate thru network

Lt Col Chandan Tiwari

Transport Layer

Lt Col Chandan Tiwari

Transport Layer 3-351

Part 4 outline
4.1 Transport-layer services 4.2 Demultiplexing 4.3 Connectionless transport: UDP 4.4 Principles of reliable data transfer 4.5 Connection-oriented transport: TCP
segment structure reliable data transfer flow control connection management

4.6 Principles of congestion control 4.7 TCP congestion control 4.8 DNS
Lt Col Chandan Tiwari

Transport Layer 3-352

Transport services and protocols


provide logical communication between app processes running on different hosts transport protocols run in end systems send side: breaks app messages into segments, passes to network layer rcv side: reassembles segments into messages, passes to app layer more than one transport protocol available to apps Internet: TCP and UDP
application transport network data link physical network data link physical network data link physical network data link physical

network data link physical

network data link physical application transport network data link physical

Lt Col Chandan Tiwari

Transport Layer 3-353

Internet transport-layer protocols


reliable, in-order delivery (TCP)
congestion control flow control connection setup
application transport network data link physical network data link physical

network data link physical network data link physical

unreliable, unordered delivery: UDP


no-frills extension of best-effort IP

network data link physical

network data link physical application transport network data link physical

services not available:


delay guarantees bandwidth guarantees
Lt Col Chandan Tiwari

Transport Layer 3-354

Part 4 outline
4.1 Transport-layer services 4.2 Demultiplexing 4.3 Connectionless transport: UDP 4.4 Principles of reliable data transfer 4.5 Connection-oriented transport: TCP
segment structure reliable data transfer flow control connection management

4.6 Principles of congestion control 4.7 TCP congestion control 4.8 DNS
Lt Col Chandan Tiwari

Transport Layer 3-355

UDP: User Datagram Protocol [RFC 768]


no frills, bare bones Internet transport protocol best effort service, UDP segments may be: lost delivered out of order to app

Why is there a UDP?


no connection establishment (which can add delay) simple: no connection state at sender, receiver small segment header no congestion control: UDP can blast away as fast as desired

connectionless:

no handshaking between UDP sender, receiver each UDP segment handled independently of others

Lt Col Chandan Tiwari

Transport Layer 3-356

UDP: more
often used for streaming multimedia apps loss tolerant Length, in bytes of UDP rate sensitive
32 bits source port # dest port # checksum

other UDP uses

DNS SNMP reliable transfer over UDP: add reliability at application layer application-specific error recovery!

segment, including header

length

Application data (message) UDP segment format


Lt Col Chandan Tiwari

Transport Layer 3-357

Part 4 outline
4.1 Transport-layer services 4.2 Demultiplexing 4.3 Connectionless transport: UDP 4.4 Principles of reliable data transfer 4.5 Connection-oriented transport: TCP
segment structure reliable data transfer flow control connection management

4.6 Principles of congestion control 4.7 TCP congestion control 4.8 DNS
Lt Col Chandan Tiwari

Transport Layer 3-358

TCP: Overview
point-to-point:

RFCs: 793, 1122, 1323, 2018, 2581

full duplex data:


bi-directional data flow in same connection MSS: maximum segment size

reliable, in-order byte

one sender, one receiver

stream:

no message boundaries

pipelined:
TCP congestion and flow control set window size

connection-oriented:
handshaking (exchange of control msgs) inits sender, receiver state before data exchange

send & receive buffers


socket door application writes data TCP send buffer
segment

flow controlled:
socket door

application reads data TCP receive buffer

sender will not overwhelm receiver


Transport Layer 3-359

Lt Col Chandan Tiwari

Figure 12.1

TCP/IP protocol suite

Lt Col Chandan Tiwari

Provide application-to-application communication Need extended addressing mechanism to applications (eg ports) First end-to-end layer Provides following services Error Control Flow Control Congestion Control Connection control Sequencing Application Multiplexing

identify

Lt Col Chandan Tiwari

TCP service is obtained by both the sender and receiver creating end points, called sockets. Each socket has a socket number (address) consisting of the IP address of the host and a 16-bit number local to that host, called a port. For TCP service to be obtained, a connection must be explicitly established between a socket on the sending machine and a socket on the receiving machine.

Lt Col Chandan Tiwari

A socket may be used for multiple connections at the same time. In other words, two or more connections may terminate at the same socket. Connections are identified by the socket identifiers at both ends, that is, (socket1, socket2). Port numbers below 1024 are called well-known ports and are reserved for standard services. 21-FTP 23-Telnet 25-SMTP 110-POP3 80-HTTP
Lt Col Chandan Tiwari

Table 12.1 Well-known ports used by TCP

Lt Col Chandan Tiwari

Stream delivery

Lt Col Chandan Tiwari

Figure 12.3

Sending and receiving buffers

Lt Col Chandan Tiwari

Figure 12.4

TCP segments

Lt Col Chandan Tiwari

Note: The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number.

Lt Col Chandan Tiwari

Example 2
Suppose a TCP connection is transferring a file of 5000 bytes. The first byte is numbered 10001. What are the sequence numbers for each segment if data is sent in five segments, each carrying 1000 bytes? Solution The following shows the sequence number for each segment:
Segment 1 Sequence Number: 10,001 (range: 10,001 to 11,000) Segment 2 Sequence Number: 11,001 (range: 11,001 to 12,000) Segment 3 Sequence Number: 12,001 (range: 12,001 to 13,000) Segment 4 Sequence Number: 13,001 (range: 13,001 to 14,000) Segment 5 Sequence Number: 14,001 (range: 14,001 to 15,000)
Lt Col Chandan Tiwari

Note: The value in the sequence number field of a segment defines the number of the first data byte contained in that segment.

Lt Col Chandan Tiwari

Note: The value of the acknowledgment field in a segment defines the number of the next byte a party expects to receive. The acknowledgment number is cumulative.

Lt Col Chandan Tiwari

TCP segment structure


URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) Internet checksum (as in UDP)

32 bits

source port #

dest port #

sequence number

acknowledgement number
head len not used

UAP R S F

checksum

Urg data pnter

Options (variable length)

application data (variable length)

Lt Col Chandan Tiwari

Transport Layer 3-372

TCP segment format

Lt Col Chandan Tiwari

TCP seq. #s and ACKs


Seq. #s: byte stream number of first byte in segments data ACKs: seq # of next byte expected from other side cumulative ACK Q: how receiver handles out-of-order segments A: TCP spec doesnt say, - up to implementor
Host A
User types C

Host B

host ACKs receipt of C, echoes back C

host ACKs receipt of echoed C

simple telnet scenario


Lt Col Chandan Tiwari

time

Transport Layer 3-374

TCP Round Trip Time and Timeout


Q: how to set TCP timeout value?
longer than RTT
but RTT varies

Q: how to estimate RTT?

too short: premature timeout unnecessary retransmissions too long: slow reaction to segment loss

SampleRTT: measured time from segment transmission until ACK receipt ignore retransmissions SampleRTT will vary, want estimated RTT smoother average several recent measurements, not just current SampleRTT

Lt Col Chandan Tiwari

Transport Layer 3-375

TCP Round Trip Time and Timeout


EstimatedRTT = (1- )*EstimatedRTT + *SampleRTT Exponential weighted moving average influence of past sample decreases exponentially fast typical value: = 0.125

Lt Col Chandan Tiwari

Transport Layer 3-376

Example RTT estimation:


RTT: gaia.cs.umass.edu to fantasia.eurecom.fr
350

300

RTT (milliseconds)

250

200

150

100 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 time (seconnds) SampleRTT Estimated RTT

Lt Col Chandan Tiwari

Transport Layer 3-377

TCP Round Trip Time and Timeout


Setting the timeout
EstimtedRTT plus safety margin
large variation in EstimatedRTT -> larger safety margin

first estimate of how much SampleRTT deviates from EstimatedRTT: DevRTT = (1-)*DevRTT + *|SampleRTT-EstimatedRTT| (typically, = 0.25) Then set timeout interval:

TimeoutInterval = EstimatedRTT + 4*DevRTT


Transport Layer 3-378

Lt Col Chandan Tiwari

Part 4 outline
4.1 Transport-layer services 4.2 Demultiplexing 4.3 Connectionless transport: UDP 4.4 Principles of reliable data transfer 4.5 Connection-oriented transport: TCP
segment structure reliable data transfer flow control connection management

4.6 Principles of congestion control 4.7 TCP congestion control 4.8 DNS
Lt Col Chandan Tiwari

Transport Layer 3-379

TCP reliable data transfer


TCP creates rdt service on top of IPs unreliable service Pipelined segments Cumulative acks TCP uses single retransmission timer Retransmissions are triggered by:
timeout events duplicate acks

Initially consider simplified TCP sender:


ignore duplicate acks ignore flow control, congestion control

Lt Col Chandan Tiwari

Transport Layer 3-380

TCP sender events:


data rcvd from app: Create segment with seq # seq # is byte-stream number of first data byte in segment start timer if not already running (think of timer as for oldest unacked segment) expiration interval: TimeOutInterval timeout: retransmit segment that caused timeout restart timer Ack rcvd: If acknowledges previously unacked segments
update what is known to be acked start timer if there are outstanding segments

Lt Col Chandan Tiwari

Transport Layer 3-381

TCP: retransmission scenarios


Host A Host B
Seq=92 timeout

Host A

Host B

SendBase = 100

timeout

loss
Sendbase = 100 SendBase = 120

Seq=92 timeout

SendBase = 120

time

lost ACK scenario

time
Lt Col Chandan Tiwari

premature timeout
Transport Layer 3-382

TCP retransmission scenarios (more)


Host A Host B

timeout SendBase = 120

loss

time Cumulative ACK scenario


Lt Col Chandan Tiwari

Transport Layer 3-383

Fast Retransmit
Time-out period often relatively long:
long delay before resending lost packet

Detect lost segments via duplicate ACKs.


Sender often sends many segments back-toback If segment is lost, there will likely be many duplicate ACKs.

If sender receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost:
fast retransmit: resend segment before timer expires

Lt Col Chandan Tiwari

Transport Layer 3-384

Part 4 outline
4.1 Transport-layer services 4.2 Demultiplexing 4.3 Connectionless transport: UDP 4.4 Principles of reliable data transfer 4.5 Connection-oriented transport: TCP
segment structure reliable data transfer flow control connection management

4.6 Principles of congestion control 4.7 TCP congestion control 4.8 DNS
Lt Col Chandan Tiwari

Transport Layer 3-385

TCP Flow Control


flow control
receive side of TCP connection has a receive buffer:
sender wont overflow receivers buffer by transmitting too much, too fast

app process may be slow at reading from buffer

speed-matching service: matching the send rate to the receiving apps drain rate

Lt Col Chandan Tiwari

Transport Layer 3-386

TCP Flow control: how it works


Rcvr advertises spare room by including value of RcvWindow in segments Sender limits unACKed data to RcvWindow
guarantees receive buffer doesnt overflow

(Suppose TCP receiver discards out-of-order segments) spare room in buffer


= RcvWindow = RcvBuffer-[LastByteRcvd LastByteRead]

Lt Col Chandan Tiwari

Transport Layer 3-387

Part 4 outline
4.1 Transport-layer services 4.2 Demultiplexing 4.3 Connectionless transport: UDP 4.4 Principles of reliable data transfer 4.5 Connection-oriented transport: TCP
segment structure reliable data transfer flow control connection management

4.6 Principles of congestion control 4.7 TCP congestion control 4.8 DNS
Lt Col Chandan Tiwari

Transport Layer 3-388

TCP Connection Management


Recall: TCP sender, receiver
establish connection before exchanging data segments initialize TCP variables: seq. #s buffers, flow control info (e.g. RcvWindow) client: connection initiator

Three way handshake:


Step 1: client host sends TCP SYN segment to server specifies initial seq # no data Step 2: server host receives SYN, replies with SYNACK segment server allocates buffers specifies server initial seq. # Step 3: client receives SYNACK, replies with ACK segment, which may contain data
Lt Col Chandan Tiwari

Socket clientSocket = new Socket("hostname","port number");

server: contacted by client


Socket connectionSocket = welcomeSocket.accept();

Transport Layer 3-389

TCP Connection Management (cont.)


Closing a connection:
client closes socket: clientSocket.close();
close
client server

Step 1: client end system


sends TCP FIN control segment to server

close

timed wait

Step 2: server receives

FIN, replies with ACK. Closes connection, sends FIN.

closed
Transport Layer 3-390

Lt Col Chandan Tiwari

TCP Connection Management (cont.)


Step 3: client receives FIN,
replies with ACK.
closing
client server

Enters timed wait will respond with ACK to received FINs

closing

Step 4: server, receives

ACK. Connection closed.

closed
Transport Layer 3-391

Lt Col Chandan Tiwari

timed wait

closed

Part 4 outline
4.1 Transport-layer services 4.2 Demultiplexing 4.3 Connectionless transport: UDP 4.4 Principles of reliable data transfer 4.5 Connection-oriented transport: TCP
segment structure reliable data transfer flow control connection management

4.6 Principles of congestion control 4.7 TCP congestion control 4.8 DNS
Lt Col Chandan Tiwari

Transport Layer 3-392

Principles of Congestion Control


Congestion:
informally: too many sources sending too much data too fast for network to handle different from flow control! manifestations: lost packets (buffer overflow at routers) long delays (queueing in router buffers) a top-10 problem!

Lt Col Chandan Tiwari

Transport Layer 3-393

Causes/costs of congestion
two senders, two receivers one router
Host A

in : original data

out

Host B

shared output link buffers

large delays when congested more work (retrans) for given goodput unneeded retransmissions: link carries multiple copies of pkt when packet dropped, any transmission capacity used for that packet was wasted! Lt Col Chandan Tiwari 3-394

Approaches towards congestion control


Two broad approaches towards congestion control: End-end congestion control:
no explicit feedback from network congestion inferred from end-system observed loss, delay approach taken by TCP

Network-assisted congestion control:


routers provide feedback to end systems single bit indicating congestion (TCP/IP ECN) explicit rate sender should send at

Lt Col Chandan Tiwari

Transport Layer 3-395

Part 4 outline
4.1 Transport-layer services 4.2 Demultiplexing 4.3 Connectionless transport: UDP 4.4 Principles of reliable data transfer 4.5 Connection-oriented transport: TCP
segment structure reliable data transfer flow control connection management

4.6 Principles of congestion control 4.7 TCP congestion control 4.8 DNS
Lt Col Chandan Tiwari

Transport Layer 3-396

TCP congestion control: additive increase, multiplicative decrease


Approach: increase transmission rate (window size), probing for usable bandwidth, until loss occurs additive increase: increase CongWin by 1 MSS every RTT until loss detected multiplicative decrease: cut CongWin in half after loss
congestion window 24 Kbytes

congestion window size

Saw tooth behavior: probing for bandwidth

16 Kbytes

8 Kbytes

time time
Lt Col Chandan Tiwari

Transport Layer 3-397

Figure 12.36

Congestion example

Lt Col Chandan Tiwari

TCP Congestion Control: details


sender limits transmission:
LastByteSent-LastByteAcked CongWin

Roughly,
rate = CongWin Bytes/sec RTT

CongWin is dynamic, function of perceived network congestion

How does sender perceive congestion? loss event = timeout or 3 duplicate acks TCP sender reduces rate (CongWin) after loss event

Lt Col Chandan Tiwari

Transport Layer 3-399

TCP Slow Start


When connection begins, CongWin = 1 MSS
Example: MSS = 500 bytes & RTT = 200 msec initial rate = 20 kbps

When connection begins, increase rate exponentially fast until first loss event

available bandwidth may be >> MSS/RTT


desirable to quickly ramp up to respectable rate

Lt Col Chandan Tiwari

Transport Layer 3-400

TCP Slow Start (more)


When connection begins, increase rate exponentially until first loss event:
Host A
RTT

Host B

double CongWin every RTT done by incrementing CongWin for every ACK received

Summary: initial rate is slow but ramps up exponentially fast


Lt Col Chandan Tiwari

time
Transport Layer 3-401

Refinement
Q: When should the exponential increase switch to linear? A: When CongWin gets to 1/2 of its value before timeout.

Implementation:
Variable Threshold At loss event, Threshold is set to 1/2 of CongWin just before loss event

Lt Col Chandan Tiwari

Transport Layer 3-402

Refinement: inferring loss


After 3 dup ACKs: CongWin is cut in half

window then grows linearly 3 dup ACKs indicates Typically inferred network capable of before timeouts delivering some segments timeout indicates a But after timeout event: more alarming CongWin instead set to congestion scenario 1 MSS; window then grows exponentially to a threshold, then Lt Col Chandan Tiwari Transport Layer 3-403 grows linearly

Philosophy:

Summary: TCP Congestion Control


When CongWin is below Threshold, sender in slow-start phase, window grows exponentially. When CongWin is above Threshold, sender is in congestion-avoidance phase, window grows linearly. When a triple duplicate ACK occurs, Threshold set to CongWin/2 and CongWin set to Threshold. When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS.
Lt Col Chandan Tiwari

Transport Layer 3-404

Example 3
What is the value of the receiver window (rwnd) for host A if the receiver, host B, has a buffer size of 5,000 bytes and 1,000 bytes of received and unprocessed data?

Solution The value of rwnd = 5,000 1,000 = 4,000. Host B can receive only 4,000 bytes of data before overflowing its buffer. Host B advertises this value in its next segment to A.

Lt Col Chandan Tiwari

Example 4
What is the size of the window for host A if the value of rwnd is 3,000 bytes and the value of cwnd is 3,500 bytes?

Solution The size of the window is the smaller of rwnd and cwnd, which is 3,000 bytes.

Lt Col Chandan Tiwari

Figure 12.21

Example 5

Lt Col Chandan Tiwari

Note: To avoid shrinking the sender window, the receiver must wait until more space is available in its buffer.

Lt Col Chandan Tiwari

Note:
Some points about TCPs sliding windows:
The size of the window is the lesser of rwnd and cwnd. The source does not have to send a full windows
worth of data. The window can be opened or closed by the receiver, but should not be shrunk. The destination can send an acknowledgment at any time as long as it does not result in a shrinking window. The receiver can temporarily shut down the window; the sender, however, can always send a segment of one byte after the window is shut down.
Lt Col Chandan Tiwari

TCP: Overview
point-to-point:

RFCs: 793, 1122, 1323, 2018, 2581

full duplex data:


bi-directional data flow in same connection MSS: maximum segment size

reliable, in-order byte

one sender, one receiver

stream:

no message boundaries

pipelined:
TCP congestion and flow control set window size

connection-oriented:
handshaking (exchange of control msgs) inits sender, receiver state before data exchange

send & receive buffers


socket door application writes data TCP send buffer
segment

flow controlled:
socket door

application reads data TCP receive buffer

sender will not overwhelm receiver


Transport Layer 3-410

Lt Col Chandan Tiwari

USER DATAGRAM PROTOCOL

Lt Col Chandan Tiwari

Figure 11.1

Position of UDP in the TCP/IP protocol suite

Lt Col Chandan Tiwari

Datagram oriented Connection less Unicast and multicast possible Unreliable


No guarantee of successful delivery If checksum not matched, ICMP error msg is send to src, datagram is discarded. Src needs to send again.

Used in multimedia appln Used in appln layer protocols


SNMP, RIP, DNS, TFTP,BOOTP

Congestion control, pkt loss has to be taken care by the appln layer. Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

The Internet protocol suite supports a connectionless transport protocol, UDP (User Datagram Protocol). UDP provides a way for applications to send encapsulated IP datagrams and send them without having to establish a connection. UDP transmits segments consisting of an 8-byte header followed by the payload.

Lt Col Chandan Tiwari

The two ports serve to identify the end points within the source and destination machines. When a UDP packet arrives, its payload is handed to the process attached to the destination port. The source port is primarily needed when a reply must be sent back to the source. By copying the source port field from the incoming segment into the destination port field of the outgoing segment, the process sending the reply can specify which process on the sending machine is to get it. The UDP length field includes the 8-byte header and the data. The UDP checksum is optional and stored as 0 if not computed.
Lt Col Chandan Tiwari

UDP does not do flow control, error control, or retransmission upon receipt of a bad segment. All of that is up to the user processes. One area where UDP is especially useful is in client-server situations. Often, the client sends a short request to the server and expects a short reply back. If either the request or reply is lost, the client can just time out and try again. Not only the code is simple, but fewer messages are required (one in each direction) than with a protocol requiring an initial setup. An application that uses UDP this way is DNS
a program that needs to look up the IP address of some host name, for example, www.cs.berkeley.edu can send a UDP packet containing the host name to a DNS server. The server replies with a UDP packet containing the host's IP address. No setup is needed in advance and no release is needed afterward. Just two messages go over the network.
Lt Col Chandan Tiwari

TCP & UDP


TCP Conn oriented Ack Reliable Slower HTTP, FTP, SMTP,Telnet, RLogin UDP Conn less No Ack Unreliable Faster DNS, DHCP, TFTP, BOOTP, SNMP

Lt Col Chandan Tiwari

APPLICATION LAYER

Lt Col Chandan Tiwari

Closest to the user. Application layer serves as the communication interface for users by providing specific application services to the user Examples of such applications Mail(SMTP,POP3,IMAP) ,Web (HTTP),DNS, transfer(FTP), Telnet etc. are File

Lt Col Chandan Tiwari

Web page consists of objects Object can be HTML file, JPEG image, Java applet, audio file, Web page consists of base HTML-file which includes several referenced objects Each object is addressable by a URL Example URL:
www.someschool.edu/someDept/pic.gif host name
Lt Col Chandan Tiwari

path name

HTTP overview
HTTP: hypertext transfer protocol
Webs application layer protocol client/server model client: browser that requests, receives, displays Web objects server: Web server sends objects in response to requests
PC running Explorer

Server running Apache Web server

Mac running Navigator

Lt Col Chandan Tiwari

HTTP overview
Uses TCP:
client initiates TCP connection (creates socket) to server, port 80 server accepts TCP connection from client HTTP messages (applicationlayer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server) TCP connection closed

HTTP is stateless
server maintains no information about past client requests

Lt Col Chandan Tiwari

HTTP connections
Nonpersistent HTTP At most one object is sent over a TCP connection. HTTP/1.0 uses nonpersistent HTTP Persistent HTTP Multiple objects can be sent over single TCP connection between client and server. HTTP/1.1 uses persistent connections in default mode

Lt Col Chandan Tiwari

two types of HTTP messages: request, response HTTP request message:


ASCII (human-readable format)
request line (GET, POST, HEAD commands)
GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 header Connection: close lines Accept-language:fr (extra carriage return, line feed)

Carriage return, line feed indicates end of message

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

status line (protocol status code status phrase) header lines

HTTP/1.1 200 OK Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 ... Content-Length: 6821 Content-Type: text/html data data data data data ...

data, e.g., requested HTML file

Lt Col Chandan Tiwari

HTTP response status codes


200 OK
request succeeded, requested object later in this message

301 Moved Permanently


requested object moved, new location specified later in this message (Location:)

400 Bad Request


request message not understood by server

404 Not Found


requested document not found on this server

505 HTTP Version Not Supported


Lt Col Chandan Tiwari

Trying out HTTP (client side) for yourself


1. Telnet to your favorite Web server:
telnet cis.poly.edu 80

Opens TCP connection to port 80 (default HTTP server port) at cis.poly.edu. Anything typed in sent to port 80 at cis.poly.edu

2. Type in a GET HTTP request:


GET /~ross/ HTTP/1.1 Host: cis.poly.edu

By typing this in (hit carriage return twice), you send this minimal (but complete) GET request to HTTP server

3. Look at response message sent by HTTP server!


Lt Col Chandan Tiwari

User-server state: cookies


Many major Web sites use cookies Four components:
1) cookie header line in the HTTP response message 2) cookie header line in HTTP request message 3) cookie file kept on users host and managed by users browser 4) back-end database at Web site

Example:
Susan access Internet always from same PC She visits a specific ecommerce site for first time When initial HTTP requests arrives at site, site creates a unique ID and creates an entry in backend database for ID

Lt Col Chandan Tiwari

Cookies: keeping state (cont.)


client
Cookie file ebay: 8734 Cookie file amazon: 1678 ebay: 8734

server
server creates ID 1678 for user cookiespecific action cookiespectific action

usual http request msg usual http response +

Set-cookie: 1678
usual http request msg

cookie: 1678
usual http response msg

one week later:


Cookie file amazon: 1678 ebay: 8734

usual http request msg

cookie: 1678
usual http response msg
Lt Col Chandan Tiwari

Cookies
What cookies can bring: authorization shopping carts recommendations user session state (Web e-mail)
Cookies and privacy: cookies permit sites to learn a lot about you you may supply name and e-mail to sites search engines use redirection & cookies to learn yet more advertising companies obtain info across sites

Lt Col Chandan Tiwari

19.1 FILE TRANSFER PROTOCOL (FTP)


File Transfer Protocol (FTP) is the standard mechanism provided by TCP/IP for copying a file from one host to another.

The topics discussed in this section include: Connections Communication Command Processing File Transfer Anonymous FTP
Lt Col Chandan Tiwari

Note: FTP uses the services of TCP. It needs two TCP connections. The well-known port 21 is used for the control connection and the well-known port 20 for the data connection.

Lt Col Chandan Tiwari

Figure 19.1

FTP

Lt Col Chandan Tiwari

Figure 19.2

Opening the control connection

Lt Col Chandan Tiwari

Figure 19.3

Creating the data connection

Lt Col Chandan Tiwari

Figure 19.5

Using the data connection

Lt Col Chandan Tiwari

Figure 19.6

Command processing

Lt Col Chandan Tiwari

Table 19.1 Access commands

Lt Col Chandan Tiwari

Table 19.2 File management commands

Lt Col Chandan Tiwari

Table 19.3 Data formatting commands

Lt Col Chandan Tiwari

Example 1
Figure 19.8 shows an example of using FTP for retrieving a list of items in a directory.

1. After the control connection to port 21 is created, the FTP server sends the 220 (service ready) response on the control connection. 2. The client sends the USER command. 3. The server responds with 331 (user name is OK, password is required). 4. The client sends the PASS command. 5. The server responds with 230 (user login is OK)

See Next Slide


Lt Col Chandan Tiwari

Example 1 (cONTINUED)

6. The client issues a passive open on an ephemeral port for the data connection and sends the PORT command (over the control connection) to give this port number to the server. 7. The server does not open the connection at this time, but it prepares itself for issuing an active open on the data connection between port 20 (server side) and the ephemeral port received from the client. It sends response 150 (data connection will open shortly). 8. The client sends the LIST message. 9. Now the server responds with 125 and opens the data connection.

See Next Slide


Lt Col Chandan Tiwari

Example 1 (cONTINUED)
10. The server then sends the list of the files or directories (as a file) on the data connection. When the whole list (file) is sent, the server responds with 226 (closing data connection) over the control connection. 11. The client now has two choices. It can use the QUIT command to request the closing of the control connection or it can send another command to start another activity (and eventually open another data connection). In our example, the client sends a QUIT command. 12. After receiving the QUIT command, the server responds with 221 (service closing) and then closes the control connection.

See Next Slide


Lt Col Chandan Tiwari

Figure 19.8

Example 1

Lt Col Chandan Tiwari

Example 3
Figure 19.9 shows an example of how an image (binary) file is stored. 1. After the control connection to port 21 is created, the FTP server sends the 220 (service ready) response on the control connection. 2. The client sends the USER command. 3. The server responds with 331 (user name is OK, a password is required). 4. The client sends the PASS command. 5. The server responds with 230 (user login is OK). 6. The client issues a passive open on an ephemeral port for the data connection and sends the PORT command (over the control connection) to give this port number to the server.

Lt Col Chandan Tiwari

See Next Slide

Example 3 (cONTINUED)
7. The server does not open the connection at this time, but prepares itself for issuing an active open on the data connection between port 20 (server side) and the ephemeral port received from the client. It sends the response 150 (data connection will open shortly). 8. The client sends the TYPE command. 9. The server responds with the response 200 (command OK). 10. The client sends the STRU command. 11. The server responds with 200 (command OK). 12. The client sends the STOR command. 13. The server opens the data connection and sends the response 250.
Lt Col Chandan Tiwari

See Next Slide

Example 3 (cONTINUED)

14. The client sends the file on the data connection. After the entire file is sent, the data connection is closed. Closing the data connection means end-of-file. 15. The server sends the response 226 on the control connection. 16. The client sends the QUIT command or uses other commands to open another data connection for transferring another file. In our example, the QUIT command is sent. 17. The server responds with 221 (service closing) and it closes the control connection.

Lt Col Chandan Tiwari

See Next Slide

Figure 19.9

Example 3

Lt Col Chandan Tiwari

FTP: File Transfer Protocol


FTP FTP user client interface local file system

file transfer

FTP server
remote file system

user at host

transfer file to/from remote host client/server model client: side that initiates transfer (either to/from remote) server: remote host ftp server: port 21
Lt Col Chandan Tiwari

FTP
TCP control connection port 21

FTP client contacts FTP server at port 21, specifying TCP as TCP data connection transport protocol FTP FTP port 20 Client obtains authorization over client server control connection(port 20) Client browses remote directory Server opens a second TCP by sending commands over data connection to transfer control connection. another file. When server receives a command for a file transfer, the Control connection: out of server opens a TCP data band connection to client After transferring one file, server FTP server maintains closes connection. state: current directory,
Lt Col Chandan Tiwari

earlier authentication

FTP commands, responses


Sample commands:
sent as ASCII text over control channel USER username PASS password LIST return list of file in current directory RETR filename retrieves (gets) file STOR filename stores (puts) file onto remote host

Sample return codes


status code and phrase (as in HTTP) 331 Username OK, password required 125 data connection already open; transfer starting 425 Cant open data connection 452 Error writing file

Lt Col Chandan Tiwari

TFTP

Lt Col Chandan Tiwari

Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol without the sophisticated features of FTP.

Lt Col Chandan Tiwari

Note: TFTP uses the services of UDP on the well-known port 69.

Lt Col Chandan Tiwari

Table 19.8 Error numbers and their meanings

Lt Col Chandan Tiwari

Figure 19.16

Connection establishment

Lt Col Chandan Tiwari

Figure 19.18

UDP port numbers used by TFTP

Lt Col Chandan Tiwari

Figure 19.19

TFTP example

Lt Col Chandan Tiwari

Figure 19.20

Use of TFTP with BOOTP

Lt Col Chandan Tiwari

DNS

Lt Col Chandan Tiwari

DNS: Domain Name System


People: many identifiers: Domain Name System: SSN, name, passport # distributed database implemented in hierarchy of Internet hosts, routers: many name servers IP address (32 bit) - used application-layer protocol for addressing host, routers, name servers datagrams to communicate to resolve name, e.g., names (address/name ww.yahoo.com - used by translation) humans Q: map between IP addresses and name ?
Lt Col Chandan Tiwari

IP addresses difficult to remember

ASCII names introduced to decouple machine names from machine addresses


Initially hosts.txt files used covert ASCII strings to IP Addresses Problems? DNS provides better mechanism for this conversion It is hierarchical domain-based naming scheme with distributed databases. Implemented over UDP
Lt Col Chandan Tiwari

Domain Name System


Internet divided into over 200 top level domains Each domain covers many hosts Domains are divided into sub domains which are further partitioned as per need. Top level domains may be generic or countries based

Lt Col Chandan Tiwari

Figure 17.2

Domain names and labels

Lt Col Chandan Tiwari

Figure 17.4

Domains

Lt Col Chandan Tiwari

Each domain named by a path upwards from it

Eg. cs.mceme.army.mil
May be absolute or relative Domain names are case insensitive

Component names can be 63 characters long and full path name must not exceed 255 characters
To create a new domain permission is required of the domain in which it will be included Once new domain is created & registered, it can permit subdomains without reference to anyone
Lt Col Chandan Tiwari

Every domain has a set of resource records associated with it

Query to the DNS returns the resource record associated with the domain name
Thus DNS primarily maps domain name to resource records

Each resource record has five fields Domain _name, TTL, Class, Type and Value
There could be more than one record for each domain.

Lt Col Chandan Tiwari

Resource records
Domain _name domain to which recored applies
TTL - expressed in seconds. Measure of stability and used in caching

Class normally always set to IN to denote Internet information


Type denotes type of record Value could be number, domain name or ASCII string depending on record type.
Lt Col Chandan Tiwari

The principal DNS resource records types

Lt Col Chandan Tiwari

Single name server can contain entire DNS database. Problems? To resolve this DNS name space is divided into non overlapping zones.

Each zone contains some part of the tree and name servers holding info about that zone.
Will have one primary name server and one or more secondary name servers

Lt Col Chandan Tiwari

Part of the DNS name space showing the division into zones.

Lt Col Chandan Tiwari

Distributed, Hierarchical Database


Root DNS Servers Root

TLD com DNS servers org DNS servers edu DNS servers

yahoo.com DNS servers

amazon.com DNS servers

pbs.org DNS servers

poly.edu DNS servers

umass.edu DNS servers

Authoritative
Lt Col Chandan Tiwari

DNS: Root name servers

Contacted by local name server that can not resolve name Root Name Server: contacts authoritative name server if name mapping not known gets mapping returns mapping to local name server
a Verisign, Dulles, VA c Cogent, Herndon, VA (also Los Angeles) d U Maryland College Park, MD k RIPE London (also Amsterdam, Frankfurt) g US DoD Vienna, VA i Autonomica, Stockholm (plus 3 h ARL Aberdeen, MD other locations) j Verisign, ( 11 locations) m WIDE Tokyo

e NASA Mt View, CA f Internet Software C. Palo Alto, CA


(and 17 other locations)

b USC-ISI Marina del Rey, CA l ICANN Los Angeles, CA

13 root name servers worldwide A-M


Lt Col Chandan Tiwari

Top-level domain (TLD) servers: responsible for com, org, net, edu, etc, and all top-level country domains uk, fr, ca, jp.
Network solutions maintains servers for com TLD Educause for edu TLD

Authoritative DNS servers: organizations DNS servers, providing authoritative hostname to IP mappings for organizations servers (e.g., Web and mail).
Can be maintained by organization or service provider

Lt Col Chandan Tiwari

Does not strictly belong to hierarchy Each ISP (residential ISP, company, university) has one.
Also called default name server

When a host makes a DNS query, query is sent to its local DNS server
Acts as a proxy, forwards query into hierarchy.

Lt Col Chandan Tiwari

Example
Host at cis.poly.edu wants IP address for gaia.cs.umass.edu
2

root DNS server

3 4 5 local DNS server dns.poly.edu 1 8 7

TLD DNS server

requesting host
cis.poly.edu

authoritative DNS server dns.cs.umass.edu

gaia.cs.umass.edu

Lt Col Chandan Tiwari

root DNS server

recursive query:
puts burden of name resolution on contacted name server heavy load?
2 7 3

6
TLD DNS server

local DNS server


dns.poly.edu

iterated query:

1 8 contacted server replies with name of server to contact requesting host I dont know this cis.poly.edu name, but ask this Lt Col Chandan Tiwari server

authoritative DNS server dns.cs.umass.edu

gaia.cs.umass.edu

Figure 17.11

Recursive resolution

Lt Col Chandan Tiwari

Figure 17.12

Iterative resolution

Lt Col Chandan Tiwari

DNS: caching and updating records


once (any) name server learns mapping, it caches mapping cache entries timeout (disappear) after some time TLD servers typically cached in local name servers
Thus root name servers not often visited

Lt Col Chandan Tiwari

DNS records
DNS: distributed db storing resource records (RR)
RR format: (name, Type=A
name is hostname value is IP address
value, type, ttl)

Type=CNAME
name is alias name for some cannonical (the real) name www.ibm.com is really
servereast.backup2.ibm.com

Type=NS
name is domain (e.g. foo.com) value is IP address of authoritative name server for this domain

value is cannonical name

Type=MX
value is name of mailserver associated with name

Lt Col Chandan Tiwari

DNS protocol, messages


DNS protocol : query and reply messages, both with same message format

msg header
identification: 16 bit # for query, reply to query uses same # flags: query or reply recursion desired recursion available reply is authoritative
Lt Col Chandan Tiwari

DNS protocol, messages


Name, type fields for a query RRs in reponse to query records for authoritative servers additional helpful info that may be used

Lt Col Chandan Tiwari

Electronic Mail: SMTP, POP, and IMAP

Lt Col Chandan Tiwari

Electronic Mail
Three major components: user agents mail servers simple mail transfer protocol: SMTP
user agent mail server

outgoing message queue user mailbox

SMTP

user agent mail server user agent

User Agent SMTP mail reader SMTP composing, editing, reading mail mail messages server e.g., Eudora, Outlook, elm, Netscape Messenger user outgoing, incoming messages agent user stored on server
agent
Lt Col Chandan Tiwari

user agent

Electronic Mail
Mail Servers
mailbox contains incoming messages for user message queue of outgoing (to be sent) mail messages SMTP protocol between mail servers to send email messages client: sending mail server server: receiving mail server
user agent mail server user agent mail server user agent

SMTP SMTP
mail server

SMTP
user agent

user agent

user agent
Lt Col Chandan Tiwari

Electronic Mail: SMTP


uses TCP to reliably transfer email message from client to server, port 25 direct transfer: sending server to receiving server three phases of transfer handshaking (greeting) transfer of messages closure command/response interaction commands: ASCII text response: status code and phrase

messages must be in 7-bit ASCII


Lt Col Chandan Tiwari

Mail message format


SMTP: protocol for exchanging email msgs RFC 822: standard for text message format: header lines, e.g.,
To: From: Subject: different from SMTP commands!

header

blank line

body

body
the message, ASCII characters only

Lt Col Chandan Tiwari

Date:Tue, 16 Jan 1996 10:37:17 (EST) From: William Stallings <ws@host.com> Subject:The syntax of RFC 822 To: Smith@otherhost.com Cc: Jones@Yet-another_host.com

Lt Col Chandan Tiwari

Traditional mail format (RFC 822) had problem in sending and receiving following messages Messages in languages with accents (e.g., French and German). Messages in non-Latin alphabets (e.g., Hebrew and Russian). Messages in languages without alphabets (e.g., Chinese and Japanese). Messages not containing text at all (e.g., audio or images).

Lt Col Chandan Tiwari

The basic idea of MIME is to continue to use the RFC 822 format, but to add structure to the message body and define encoding rules for non-ASCII messages. By not deviating from RFC 822, MIME messages can be sent using the existing mail programs and protocols. All that has to be changed are the sending and receiving programs, which users can do for themselves. MIME defines five new message headers MIME version Content type Content transfer encoding Content Id Content Description
Lt Col Chandan Tiwari

Message format: multimedia extensions


MIME: multimedia mail extension, RFC 2045, 2056 additional lines in msg header declare MIME content type
MIME version method used to encode data multimedia data type, subtype, parameter declaration
From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data ..... ......................... ......base64 encoded data

encoded data

Lt Col Chandan Tiwari

Mail access protocols


user agent

SMTP

SMTP

access protocol

user agent

senders mail server

receivers mail server

SMTP: delivery/storage to receivers server Mail access protocol: retrieval from server POP: Post Office Protocol authorization (agent <-->server) and download IMAP: Internet Mail Access Protocol more features (more complex) manipulation of stored msgs on server HTTP: Hotmail , Yahoo!Lt Mail, etc. Col Chandan Tiwari

20.1 ARCHITECTURE
To explain the architecture of email, we give four scenarios. We begin with the simplest situation and add complexity as we proceed. The fourth scenario is the most common in the exchange of email.

The topics discussed in this section include: First Scenario Second Scenario Third Scenario Fourth Scenario

Lt Col Chandan Tiwari

Figure 20.1

First scenario

Lt Col Chandan Tiwari

Note: When the sender and the receiver of an email are on the same system, we need only two user agents.

Lt Col Chandan Tiwari

Figure 20.2

Second scenario

Lt Col Chandan Tiwari

Note: When the sender and the receiver of an email are on different systems, we need two UAs and a pair of MTAs (client and server).

Lt Col Chandan Tiwari

Figure 20.3

Third scenario

Lt Col Chandan Tiwari

Note: When the sender is connected to the mail server via a LAN or a WAN, we need two UAs and two pairs of MTAs (client and server).

Lt Col Chandan Tiwari

Figure 20.4

Fourth scenario

Lt Col Chandan Tiwari

Figure 20.5

Push vs. pull

Lt Col Chandan Tiwari

Note: When both sender and receiver are connected to the mail server via a LAN or a WAN, we need two UAs, two pairs of MTAs (client and server), and a pair of MAAs (client and server). This is the most common situation today.
Lt Col Chandan Tiwari

20.2 USER AGENT


The user agent (UA) provides service to the user to make the process of sending and receiving a message easier.

The topics discussed in this section include: Services Provided by a User Agent User Agent Types Sending Mail Receiving Mail Addresses Mailing List MIME

Lt Col Chandan Tiwari

Figure 20.6

User agent

Lt Col Chandan Tiwari

Note: Some examples of command-driven user agents are mail, pine, and elm

Lt Col Chandan Tiwari

Note: Some examples of GUI-based user agents are Eudora, Outlook, and Netscape.

Lt Col Chandan Tiwari

Figure 20.7

Format of an email

Lt Col Chandan Tiwari

20.3 MESSAGE TRANSFER AGENT: SMTP


The actual mail transfer requires message transfer agents (MTAs). The protocol that defines the MTA client and server in the Internet is called Simple Mail Transfer Protocol (SMTP).

The topics discussed in this section include: Commands and Responses Mail Transfer Phases

Lt Col Chandan Tiwari

Figure 20.13

SMTP range

Lt Col Chandan Tiwari

Figure 20.14

Commands and responses

Lt Col Chandan Tiwari

Figure 20.15

Command format

Lt Col Chandan Tiwari

20.4 MESSAGE ACCESS AGENT: POP AND IMAP


The third stage of mail delivery uses a message access agent; the client must pull messages from the server. Currently two message access protocols are available: Post Office Protocol, version 3 (POP3) and Internet Mail Access Protocol, version 4.

The topics discussed in this section include: POP3 IMAP4

Lt Col Chandan Tiwari

Figure 20.19

POP3 and IMAP4

Lt Col Chandan Tiwari

Figure 20.20

POP3

Lt Col Chandan Tiwari

20.5 WEB-BASED MAIL


Some websites such as Hotmail and Yahoo provide email service to anyone who accesses the site. Mail transfer and retrieval requires the use of HTTP.

Lt Col Chandan Tiwari

POP3 vs IMAP
More about POP3 Previous example uses download and delete mode. Bob cannot re-read e-mail if he changes client Download-and-keep: copies of messages on different clients POP3 is stateless across sessions IMAP Keep all messages in one place: the server

Allows user to organize messages in folders IMAP keeps user state across sessions:
names of folders and mappings between message IDs and folder name

Lt Col Chandan Tiwari

A server that sits between a client application, such as a Web browser, and a real server. It intercepts all requests to the real server to see if it can fulfill the requests itself. It forwards the request to the real server. Proxy servers have two main purposes:
Improve and Filter Requests. Located at border between private network and the firewall or public network

With a proxy server, the client never actually connects to outside network; instead the proxy makes the connection and relays allowable protocols/content to the client
Filters at the application layer (HTTP, FTP, Telnet, Lt Col Chandan Tiwari etc.)

Proxy receives requests for certain applications


For example, an HTTP request for a particular URL

Proxy checks if request is permitted


For example, users might not be allowed to access gambling sites from a corporate computer

If request is okay, proxy passes request on to final destination


Otherwise, request is denied

Proxy may also serve a caching function


If request can be handled locally, dont bother to pass it on to final destination
Lt Col Chandan Tiwari

Proxy Server

Proxy Server

Lt Col Chandan Tiwari

Host Configuration: BOOTP and DHCP

Lt Col Chandan Tiwari

16.1 BOOTP
The Bootstrap Protocol (BOOTP) is a client/server protocol that configures a diskless computer or a computer that is booted for the first time. BOOTP provides the IP address, net mask, the address of a default router, and the address of a name server.

The topics discussed in this section include: Operation Packet Format

Lt Col Chandan Tiwari

Figure 16.1

Client and server on the same network

Lt Col Chandan Tiwari

Figure 16.2

Client and server on two different networks

Lt Col Chandan Tiwari

Figure 16.3

Use of UDP ports

Lt Col Chandan Tiwari

Figure 16.4

BOOTP packet format

Lt Col Chandan Tiwari

Figure 16.5

Option format

Lt Col Chandan Tiwari

Table 16.1 Options for BOOTP

Lt Col Chandan Tiwari

16.2 DHCP
The Dynamic Host Configuration Protocol (DHCP) provides static and dynamic address allocation that can be manual or automatic.

The topics discussed in this section include: Static Address Allocation Dynamic Address Allocation Manual and Automatic Configuration Packet Format Transition States Exchanging Messages

Lt Col Chandan Tiwari

Note: DHCP provides static and dynamic address allocation that can be manual or automatic.

Lt Col Chandan Tiwari

Figure 16.6

DHCP packet

Lt Col Chandan Tiwari

Table 16.2 Options for DHCP

Lt Col Chandan Tiwari

Figure 16.7

DHCP transition diagram

Lt Col Chandan Tiwari

Figure 16.8

Exchanging messages

Lt Col Chandan Tiwari

NETWORK SECURITY

Lt Col Chandan Tiwari

Authentication - assurance that the communicating entity is the one claimed Access Control - prevention of the unauthorized use of a resource Confidentiality protection of data from unauthorized disclosure Integrity - assurance that data received is as sent by an authorized entity Non-Repudiation - protection against denial by one of the parties in a communication Availability - ensuring that data is always avilable to authorised users

Lt Col Chandan Tiwari

CRYPTOGRAPHY

Lt Col Chandan Tiwari

or conventional / secret-key / single-key sender and recipient share a common key all classical encryption algorithms are secret-key Data Encryption Standard (DES) , Triple-DES,Advance Encryption Standard (AES)

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

public-key/two-key/asymmetric cryptography involves the use of two keys:


a public-key, which may be known by anybody, and can be used to encrypt messages, and verify signatures a private-key, known only to the recipient, used to decrypt messages, and sign (create) signatures

is asymmetric because
those who encrypt messages or verify signatures cannot decrypt messages or create signatures

Lt Col Chandan Tiwari

Encryption/decryption: The sender encrypts a message with the recipients public key.
RSA(Rivest, Shamir & Adleman)

Digital signature: The sender signs a message with its private key.
DSS(Digital Signature Standard),RSA

Key exhange: Two sides cooperate to exhange a session key.


DH(Diffie Hillmen)
Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Digital Signatures

Lt Col Chandan Tiwari

It is a system by which one party can send a signed message to another party in such a way that following conditions hold Receiver can verify the identity of the sender Sender cannot later repudiate the contents of the message Integrity of the message is maintained

Lt Col Chandan Tiwari

A system based on the idea of a one-way hash function that takes a long piece of plaintext and from it computes a fixed length binary string. This hash function MD is called a message digest. Imp properties are:
Given P, It is easy to compute MD(P) Given MD(P) it is impossible to find P Given P no one can find P such that MD(P)=MD(P) A change to the input of even 1 bit produces a very different output

MD5(128 bit),SHA(Secure Hash Algorithm)1(160 bit)

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

certificates allow key exchange without realtime access to public-key authority a certificate binds identity to public key
usually with other info such as period of validity, rights of use etc

with all contents signed by a trusted PublicKey or Certificate Authority (CA) can be verified by anyone who knows the public-key authoritys public-key

Lt Col Chandan Tiwari

E-Mail Security

Lt Col Chandan Tiwari

widely used for secure email developed by Phil Zimmermann selected best available crypto algs to use integrated into a single program Provides encryption, digital sign and compression

Lt Col Chandan Tiwari

security enhancement to MIME email


original Internet RFC822 email was text only MIME provided support for varying content types and multi-part messages with encoding of binary data to textual form S/MIME added security enhancements Provides encryption, digital sign

S/MIME support in various modern mail agents: MS Outlook, Netscape etc


Lt Col Chandan Tiwari

S/MIME uses digital certificates (Digital IDs) each client has a list of trusted CAs certs and own public/private key pairs & certs certificates must be signed by trusted CAs

Lt Col Chandan Tiwari

Secure Sockets Layer. SSL uses a cryptographic system that uses two keys to encrypt data a public key known to everyone and a private or secret key known only to the recipient of the message. SSL creates a secure connection between a client and a server, over which any amount of data can be sent securely.

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

On the sending side, SSL receives from the application raw application data (such as an HTTP or IMAP message), encrypts the data and directs the encrypted data to a TCP socket. On the receiving side, SSL reads from the TCP socket ,decrypts the data, and directs the data to the application.

Lt Col Chandan Tiwari

A user, say Bob, surfs the Web and clicks on a link that takes him to a secure page housed by Alice's SSL-enabled server. The protocol part of the URL for this page is "https" rather than the ordinary "http". The browser and server then run the SSL handshake protocol, which (1) authenticates the server and (2) generates a shared symmetric key. Both of these tasks make use of the RSA public-key technology. During this phase, Alice sends Bob her certificate, from which Bob obtains Alice's public key. Bob then creates a random symmetric key, encrypts it with Alice's public key, and sends the encrypted key to Alice. Bob and Alice now share a symmetric session key. Once this handshake protocol is complete, all data sent between the browser and server (over TCP connections) is encrypted using the symmetric session key.
Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

SSH (Secure Shell) is a program to log into another computer over a network, to execute commands in a remote machine, and to move files from one machine to another. It provides strong authentication and secure communications over unsecure channels. It is intended as a replacement for telnet

Lt Col Chandan Tiwari

IPSec

Lt Col Chandan Tiwari

IPSec provides security at network (Internet) layer. Mandatory for next-generation IPv6, optional for current-generation (IPv4).

Lt Col Chandan Tiwari

IPSec provides two basic modes of use:


transport mode: for IPSec-aware hosts as endpoints. tunnel mode: for IPSec-unaware hosts, established by intermediate gateways or host OS.

IPSec provides authentication and/or confidentiality services for data.


AH and ESP protocols.

Lt Col Chandan Tiwari

IP datagram Header Payload

IP datagram Header Payload

Network

Lt Col Chandan Tiwari

Inner IP datagram
Header Payload

Inner IP datagram Header Network Security Gateway Payload

Security
Gateway

Inner IP datagram
Outer Header

Inner IP datagram
Header Payload
Outer Header

Header

Payload

Lt Col Chandan Tiwari

VPN

Lt Col Chandan Tiwari

VPN Stands for Virtual Private Network A method of ensuring private, secure communication between hosts over an insecure medium using tunneling Usually between geographically separate locations, but doesnt have to be Via tunneling and software drivers, computer is logically directly connected to a network that it is not physically a part of
Lt Col Chandan Tiwari

Uses some means of encryption to secure communications


IPSec SSH Software could be written to support any type of encryption scheme

Two main types of VPNs


Remote-Access Site-to-Site
Lt Col Chandan Tiwari

SSH over PPP

SSL over PPP using IPSec


Others (PPTP, L2TP, etc)
Lt Col Chandan Tiwari

Malicious Codes

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

a piece of self-replicating code attached to some other code both propagates itself & carries a payload
carries code to make copies of itself as well as code to perform some covert task

Lt Col Chandan Tiwari

replicating but not infecting program typically spreads over a network


cf Morris Internet Worm in 1988 led to creation of CERTs

using users distributed privileges or by exploiting system vulnerabilities widely used by hackers to create zombie PC's, subsequently used for further attacks, esp DoS major issue is lack of security of permanently connected systems, esp PC's

Lt Col Chandan Tiwari

program with hidden side-effects which is usually superficially attractive


eg game, s/w upgrade etc

when run performs some additional tasks


allows attacker to indirectly gain access they do not have directly

often used to propagate a virus/worm or install a backdoor or simply to destroy data


Lt Col Chandan Tiwari

first-generation
scanner uses virus signature to identify virus or change in length of programs

second-generation
uses heuristic rules to spot viral infection or uses program checksums to spot changes

third-generation
memory-resident programs identify virus by actions

fourth-generation
packages with a variety of antivirus techniques eg scanning & activity traps, access-controls eg McFee,Norton

Lt Col Chandan Tiwari

A sniffer is any device, whether software or hardware, that grabs information traveling along a network. That network could be running any protocol: Ethernet, TCP/IP, IPX, or others (or any combination of these). The purpose of the sniffer to place the network interface--in this case, the Ethernet adapter--into promiscuous mode and by doing so, to capture all network traffic.

Promiscuous mode refers to that mode where all workstations on a network listen to all traffic, not simply their own. In other words, non-promiscuous mode is where a workstation only listens to traffic route it its own address. In promiscuous mode, the workstation listens to all traffic, no matter what address this traffic was intended for.
Lt Col Chandan Tiwari

A scanner is a program that automatically detects security weaknesses in a remote or local host. True scanners are TCP port scanners, which are programs that attack TCP/IP ports and services (Telnet or FTP, for example) and record the response from the target. If used by system administrators, scanners help strengthen security in the immediate sense

Lt Col Chandan Tiwari

A weakness in your system that could be exploited by an adversary More generally, something that could go wrong Vulnerabilities exist in OS, Programs, Softwares etc

Lt Col Chandan Tiwari

DOS
- Attacks characterized by an explicit attempt by attackers to prevent legitimate users of a service from using the desired resources. - E.g. attempts to flood a network, attempts to disrupt connections between two machines, crashing an operating system by exploiting some OS / application vulnerability.

Lt Col Chandan Tiwari

DISTRIBUTED DENIAL OF SERVICE DDOS

A Distributed Denial Of Service (DDoS) attack is a DoS attack multiplied by the number of attackers.

Lt Col Chandan Tiwari

DDOS
Slave Master

Slave

Real attacker sends an execute message to the control master program.


Slave Slave

receiving the attack command, the ControlUpon master receives the execute The real attacker hiding behind control attack daemons begin the attack on the message and propagates theis command to master and will its have to impregnate the victim. the attack daemons under control. master and the slaves (zombies) much earlier before it carries out the attack.
Slave Real Attacker

Lt Col Chandan Tiwari

Victim

A spoofing attack involves nothing more than forging one's source address. It is the act of using one machine to impersonate another Spoofing attacks differ from random scanning and other techniques used to ascertain holes in the system. Spoofing attacks occur only after a particular machine has been identified as vulnerable. By the time the cracker is ready to conduct a spoofing attack, he or she knows the target network is vulnerable and which machine is to be attacked

Lt Col Chandan Tiwari

Any system can spoof a reply to an ARP request Receiving system will cache the reply
Overwrites existing entry Adds entry if one does not exist

Usually called ARP poisoning

Lt Col Chandan Tiwari

Client (C)

Server (S)

Hostile

Real ARP Reply

Spoofed ARP ReplyC Spoofed ARP ReplyS

Broadcast ARP Request

Lt Col Chandan Tiwari

In DNS spoofing, the cracker compromises the DNS server and explicitly alters the hostname-IP address tables. These changes are written into the translation table databases on the DNS server. Thus, when a client requests a lookup, he or she is given a bogus address; this address would be the IP address of a machine completely under the cracker's control.

Lt Col Chandan Tiwari

FIREWALL

Lt Col Chandan Tiwari

a choke point of control and monitoring interconnects networks with differing trust imposes restrictions on network services
only authorized traffic is allowed

auditing and controlling access


can implement alarms for abnormal behavior

is itself immune to penetration provides perimeter defence Firewall Functions- Packet Filtering, NAT, Proxy
Lt Col Chandan Tiwari

highly secure host system potentially exposed to "hostile" elements hence is secured to withstand this may support 2 or more net connections may be trusted to enforce trusted separation between network connections runs circuit (NAT) / application level gateways (proxy) or provides externally accessible services
Lt Col Chandan Tiwari

A bastion host is a gateway between an inside network and an outside network. Used as a security measure, the bastion host is designed to defend against attacks aimed at the inside network. Depending on a network's complexity and configuration, a single bastion host may stand guard by itself, or be part of a larger security system with different layers of protection.

Lt Col Chandan Tiwari

Lt Col Chandan Tiwari

Intrusion Detection System (IDS)

Lt Col Chandan Tiwari

aim to increase privileges on system basic attack methodology


target acquisition and information gathering initial access privilege escalation covering tracks

key goal often is to acquire passwords so then exercise access rights of owner
Lt Col Chandan Tiwari

statistical anomaly detection


threshold profile based

rule-based detection
anomaly penetration identification

Lt Col Chandan Tiwari

front-line defense against intruders users supply both: login determines privileges of that user password to identify them passwords often stored encrypted need policies and good user education ensure users change the passwords to something they can remember protect password file from general access set technical policies to enforce good passwords minimum length (>6) require a mix of upper & lower case letters, numbers, punctuation

Lt Col Chandan Tiwari

Passwords in Layers BIOS Setup, Startup, User, Screen Saver may reactively run password guessing tools may enforce periodic changing of passwords have system monitor failed login attempts, & lockout account if see too many in a short period do need to educate users and get support be aware of social engineering attacks

Lt Col Chandan Tiwari

WIRELESS LAN PROTOCOLS THE MAC SUB LAYER

Lt Col Chandan Tiwari

IEEE 802.11 Runs at speed of 1 Mbps or 2 Mbps


IEEE 802.11a Wider freq band and runs at a speed of 54 Mbps IEEE 802.11b Same freq band as IEEE 802.11 but uses different modulation technique. Runs at a speed of 11 Mbps

IEEE 802.11g Another variation IEEE 802.15 - Bluetooth IEEE 802.16 - WiMAX
Lt Col Chandan Tiwari

Wireless Protocols - General

Two modes:
Basis Service Set (BSS) BSS with base stn. Base stn is also called an Access Point (AP)
Lt Col Chandan Tiwari

Wireless LAN protocols

CSMA cannot be used directly! Why?

Because the range of a single radio may not cover the entire system.
Lt Col Chandan Tiwari

Wireless LAN protocols

The hidden station problem.

The exposed station problem.

Lt Col Chandan Tiwari

In CSMA, a stn senses for carrier in its vicinity. Here, stn should know whether there is activity in the vicinity of the receiver.

Lt Col Chandan Tiwari

Multiple Access with Collision Avoidance (MACA) protocol. (a) A sending an Request To Send to B. (b) B responding with a Clear To Send to A.
Lt Col Chandan Tiwari

What happens when B and C sent a RTS to A at the same time?


Lt Col Chandan Tiwari

We shall cover: The 802.11 Protocol Stack The 802.11 Physical Layer The 802.11 MAC Sublayer Protocol The 802.11 Frame Structure Services - OTW

Lt Col Chandan Tiwari

IEEE 802.11 Protocol Stack

Lt Col Chandan Tiwari

Five transmission techniques permitted which differ in achievable speeds and technology used. Infrared Similar to TV remote control FHSS Frequency hopping Spread Spectrum DSSS Direct Sequence Spread Spectrum OFDM Orthogonal Frequency Division Multiplexing. HR-DSSS High Rate DSSS.
Lt Col Chandan Tiwari

Wireless protocols suffer from The hidden station problem and The exposed station problem.

To overcome this, 802.11 supports two modes of operation: DCF Distributed Coordinated Function. PCF Point Coordination Function.

Lt Col Chandan Tiwari

DCF Distributed Coordination Function PCF Point Coordination Function


does not use any kind of central control

uses base station to control all activity in the cell


Lt Col Chandan Tiwari

DCF uses CSMA/CA protocol which has two modes. First mode is simple CSMA with binary backoff algorithm Other mode uses MACA for Wireless (MACAW) with virtual channel sensing. We shall see an example.

Lt Col Chandan Tiwari

request to send

timer

clear to send
network allocation vector

C can hear A (RTS) and D can hear B (CTS)

Lt Col Chandan Tiwari

wireless environments very noisy! probability of frame to be transmitted successfully inversely proportional to the frame length damaged frames have to be retransmitted So, what is the solution?

Lt Col Chandan Tiwari

Solution: each long frame fragmented into smaller pieces, with fragments having their own Checksum the fragments are acknowledged using Stop-andWait protocol
i.e. fragment k+1 is not transmitted till ack for fragment k is received.

Once a channel has been acquired using RTS & CTS, multiple fragments can be sent in a row. Sequence of fragments is called a Fragment Burst.
Lt Col Chandan Tiwari

A fragment burst.

only damaged fragments retransmitted -throughput increased NAV keeps the other station quiet only until the next ACK How to transmit whole frame without interference? (Point Coordination Function Polling/ Beacon Frame)

Lt Col Chandan Tiwari

802.11 MAC Sub Layer Protocol

Inter Frame Spacing in 802.11 to allow DCF and PCF to coexist in one cell.
Lt Col Chandan Tiwari

Version Type Data, control or management Subtype RTS or CTS To/From DS - frame is going or coming from intercell distr sys. MF- more fragments to follow Retry- retxn of earlier frame Pwr - to put rxr to sleep/ wake it More tx has addl frames for rx W frame encrypted using WEP O process sequence of frames in order

Duration how long frame & its ack will occupy channel. Aids in NAV mechanism Address MAC addresses. Why four? Seq to number fragments. 12 bits for frame id and 4 bits for fragment id. Data Checksum

Lt Col Chandan Tiwari

WiMAX is a standards-based wireless technology that provides high-throughput broadband connections over long distances as an alternative to cable and DSL (last mile connectivity). Defines fixed broadband wireless access systems employing a point-to-multipoint (PMP) architecture. WiMAX applications include:
"last mile" broadband connections Hotspot and cellular backhaul High-speed enterprise connectivity for businesses.

Lt Col Chandan Tiwari

WiMAX will provide fixed, nomadic, portable and, eventually, mobile wireless broadband connectivity without the need for direct line-of-sight with a base station. In a typical cell radius deployment of three to 10 Kms, WiMAX systems can be expected to deliver capacity of up to 40 Mbps per channel, for fixed and portable access applications. This is enough BW to simultaneously support hundreds of businesses with T-1 speed connectivity and thousands of residences with DSL speed connectivity.

Lt Col Chandan Tiwari

Mobile network deployments are expected to provide up to 15 Mbps of capacity within a typical cell radius deployment of up to three Kms. It is expected that WiMAX technology will be incorporated in notebook computers and PDAs in 2006, allowing for urban areas and cities to become MetroZones for portable outdoor broadband wireless access.

Lt Col Chandan Tiwari

Wireless broadband access is set up like cellular systems, using base stations that service a radius of several Kms. Towers not necessary for base stations. Antenna may be located on a rooftop of a tall building. A customer premise unit (CPE), similar to a satellite TV setup, connects the base station to a customer. The signal is then routed via standard Ethernet cable either directly to a single computer, or to an 802.11 hot spot or a wired Ethernet LAN.

Lt Col Chandan Tiwari

Customer Premise Equipment (CPE)


Generation CPE
First generation Second generation Thirdgeneration

Time Frame

Cost
$350.

Outdoor-installable subscriber 2005 stations akin to a small satellite dish Smaller indoor antennae with self-installable modems similar to a cable or DSL modem CPEs will be integrated into laptops and other portable devices
Lt Col Chandan Tiwari

late 2005/ early 2006 2006-2007

$250

$100

Wi-Fi and WiMAX are complementary technologies. WiMAX complements Wi-Fi by extending its reach and providing "WiFi like user experience on a larger geographical scale.

WiMAX is "last mile" technology connecting businesses and homes to high-speed Internet.
Wi-Fi provides the wireless LAN connectivity within a building or a home. Both WiMAX and Wi-Fi use the same core technology of wireless modulation - Orthogonal Frequency Division Multiplexing (OFDM )

Lt Col Chandan Tiwari

To date, all Wi-Fi technology has been delivered in unlicensed spectrum. WiMAX is going to use one unlicensed frequency(5.8 GHz, same as Wi-Fi) and two licensed frequencies (2.5 Ghz & 3.5 Ghz). Thus, WiMAX can use greater output power and broadcast longer distances. WiMAX is designed to be a carrier-grade technology, which requires a higher level of reliability and quality of service than are now available in typical Wi-Fi implementations.

Lt Col Chandan Tiwari

When WiMAX is fully developed, you'll no longer be limited to 300 feet within the Wi-Fi hotspot (connection available everywhere). WiMAX provides greater bandwidth and stronger encryption than WiFi.

It also aims to provide connectivity to network endpoints without direct line of sight in some circumstances.

Lt Col Chandan Tiwari

IEEE approved the initial 802.16 standard for wireless MAN for the 10-66 GHz frequency range in December 2001. IEEE 802.16a standardization focused on fixed broadband access (for sub 11 GHz). IEEE 802.16-2004 enhanced the standard by providing support for indoor CPE. IEEE 802.16e standard is planned to be an extension to the approved IEEE 802.16-2004 standard for adding data mobility to the current standard, which is designed mainly for fixed operation.

Lt Col Chandan Tiwari

What differentiates WiMAX from earlier broadband wireless access (BWA) iterations is standardization. Chipsets are currently custom-built for each broadband wireless access vendor, adding time and cost to the process. Its equivalent or competitor in Europe is HIPERMAN. WiMAX Forum is working on methods to make 802.16 and HIPERMAN interoperate seamlessly. Korea's telecoms industry has developed its own standard, WiBro. Now, Intel and LG Electronics have agreed on interoperability between WiBro and WiMAX.

Lt Col Chandan Tiwari

IEEE 802.16 is point-to-multipoint broadband wireless access standard for systems in the frequency ranges 10-66 GHz and sub 11 GHz. The standard covers both the MAC and the physical layers. At higher frequencies, line of sight is a must. This requirement eases the effect of multipath, allowing for wide channels, typically greater than 10 MHz in bandwidth. This gives IEEE 802.16 the ability to provide very high capacity links on both the uplink and the downlink. For sub 11 GHz non line of sight capability is a requirement. Designed to accommodate either Time Division Duplexing (TDD) or Frequency Division Duplexing (FDD) deployments.

Lt Col Chandan Tiwari

MAC layer was designed specifically for the PMP wireless access environment. It supports higher layer protocols such as ATM or Internet Protocol (IP), and is designed to easily accommodate future protocols that have not yet been developed. The MAC layer is designed for very high bit rates (up to 268 Mbps each way) of the truly broadband physical layer, while delivering ATM compatible Quality of Service (QoS); UGS, rtPS, nrtPS, and Best Effort. The frame structure allows terminals to be dynamically assigned uplink and downlink burst profiles according to their link conditions. The 802.16 MAC layer uses a variable length Protocol Data Unit (PDU).

Lt Col Chandan Tiwari

THANK YOU

You might also like