Professional Documents
Culture Documents
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
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
Simplex
Half-Duplex
Full-Duplex
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)
NETWORKS
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.
Computer Network
Computer Network is a collection of autonomous computers interconnected by a single technology. eg Ethernet LAN Is Internet a computer network?
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
Performance
Throughput (High) Delay (Low)
Reliability Security
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
Based on scale
Personal Area Networks (PAN) Local Area Networks (LAN) Metropolitan Area Networks (MAN) Wide Area Networks (WAN)
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)
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
LAN WAN
MAN
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
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
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
MCEME Secunderabad
Tiered Architecture
Mesh Topology
Star Topology
Tree Topology
Bus Topology
Ring Topology
Hybrid Topology
Data Transmission
Lt Col Chandan Tiwari
Baseband
Broadband
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.
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
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.
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.
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
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 .
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.
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
Layering hides information If it did not (layering violation) then changes to one layer could require changes everywhere Sometimes hiding information can degrade performance
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
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
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
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
Switching
Circuit Switch
Lt Col Chandan Tiwari
Packet Switch
Lt Col Chandan Tiwari
SWITCHING
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
Switched Networks
Circuit Switched NW
Packet Switched NW
Message Switched NW
Datagram NW
Virtual Circuit NW
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.
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
D E L A Y
Efficiency
Low
Delay
Minimal No waiting at SWs Total delay = Time to est conn + transfer Data + Disconnect the circuit
MESSAGE SW
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
PACKET SW
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
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
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
7
NIC Card
6 5 4 3
2
1
Data Link
Physical
Hub
7 6 5 4 3 2 1
Application
Provides network services to application processes (such as electronic mail, file transfer, and terminal emulation)
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
7 6 5
Application
Network services to applications Data representation Inter-host communication Establishes, manages, and terminates sessions between applications
Presentation
Session
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
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
7 6 5 4
3
2
Application
Presentation Session Transport Network Data Link Physical
6
5 4 3 2 1
Data representation
Inter-host communication End-to-end connection reliability
Host A 7 6 5 4 3 2 1 Application Presentation Session Transport Network Data Link Bits Physical PDUs PDUs
PDUs
Segments Packets Frames
Transport
Network Data Link Physical
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
source
datagram Hn Ht
Hl Hn Ht
message segment Ht
M M M M
frame
Data Encapsulation
link physical
Hl Hn Ht
switch
destination
M
Ht Hn Ht Hl Hn Ht M M M
Hn Ht Hl Hn Ht
M M
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
It includes
coding scheme to represent a bit bit-level synchronization Data rate (transmission rate) shapes and sizes of connectors
Layer 2
Data Link Layer
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
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
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
Network 1
Node
1 2 3
1 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.
Network 1aceb0b.
Node 0000.0c00.6e25
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
Routing Tables
Novell Apple
IPX 4b.0800.0121.ab13
DEC
IP
Token Ring
AppleTalk 100.110
VAX
DECnet 5.8
Token Ring
VAX
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
A A
B B Stub network
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
Host 5
Routing Table
Destination Outgoing Network Interface 1 2 3
Lt Col Chandan Tiwari
E0 To0 E1
Data
From LAN
1.3
Token Ring
Token Ring
To WAN
A A
Frame Relay
To LAN
2.4
Layer 4
Transport Layer
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
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
Transport layer
Establishes Connection
Sender
Receiver
Connection Established
Data Transfer (Send Segments)
Transmit
Sender Receiver
Stop
Not Ready
Go
Buffer OK
Window Size = 1
Send 1
Sender
Send 2
Sender
Receiver
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
Not common Establishes, manages, and terminates sessions between applications Provides full-duplex service, expedited data delivery, and session synchronization
Duplex
if transport layer is simplex, concatenates two transport endpoints together
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
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.)
Layer 7
Application Layer
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.
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.
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
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 .
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
No session or presentation layer. Application layer serves as the communication interface Protocols - Virtual terminal (telnet), FTP, SMTP, DNS,
HTTP, etc.
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.
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
ADDRESSES
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.
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.
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.
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.
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.
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
Carrier Sense Multiple Access Protocols (CSMA) Collision-Free Protocols Wireless LAN Protocols
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)
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.
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.
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.
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
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
(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.
Network layer
LLC LLC
PKT
PKT
MAC
MAC LLC
PKT
MAC
Physical layer
WIRELESS 802.11
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
Infrastructure
Adhoc
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
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.
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
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.
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.
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.
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)
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
4
CRC
Bits
2
Protocol version
2
Type
4
Subtype
1
To AP
1
From AP
1
More frag
1
Retry
1
WEP
1
Rsvd
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
802.11 frame
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.7 PPP
link
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
transportation analogy
trip from Princeton to
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
communication link transportation mode = link layer protocol travel agent = routing algorithm
Lt Col Chandan Tiwari 5: DataLink Layer 5-227
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
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:
5-229
Adaptors Communicating
datagram sending node frame adapter link layer protocol frame adapter rcving node
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-
services 3.2 Error detection and correction 3.3Multiple access protocols 3.4 Link layer addressing 3.5 Ethernet
3.7 PPP
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
Parity Checking
Single Bit Parity:
Detect single bit errors
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
<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
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[
services 3.2 Error detection and correction 3.3Multiple access protocols 3.4 Link layer addressing 3.5 Ethernet
3.7 PPP
interference
channel, i.e., determine when node can transmit communication about channel sharing must use channel itself!
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
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
trans time) in each round unused slots go idle example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle
frequency bands
Lt Col Chandan Tiwari 5: DataLink Layer 5-245
transmit immediately
collision probability increases: frame sent at t0 collides with other frames sent in [t0-1,t0+1]
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
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
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
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)
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
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.
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 10 collisions, randomization interval frozen at 1023. Nodes give up after 16 collisions. Left to upper layers to resolve the issue
CSMA collisions
collisions can still occur:
propagation delay means two nodes may not hear each others transmission
collision:
entire packet transmission time wasted
note:
role of distance & propagation delay in determining collision probability
wastage
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
Token passing: control token passed from one node to next sequentially. token message concerns:
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
services 3.2 Error detection and correction 3.3Multiple access protocols 3.4 Link layer addressing 3.5 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
1A-2F-BB-76-09-AD
71-65-F7-2B-08-53
= adapter
0C-C4-11-6F-E3-98
(to assure uniqueness) Analogy: (a) MAC address: like Social Security Number (b) IP address: like postal address MAC flat address portability
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
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
MAC address pair in its ARP table until information becomes old (times out) soft state: information that times out (goes away) unless refreshed
ARP is plug-and-play: nodes create their ARP tables without intervention from net administrator
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 server
223.1.2.9
223.1.2.1
223.1.2.2
223.1.3.27 223.1.3.2
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
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
services 3.2 Error detection and correction 3.3Multiple access protocols 3.4 Link layer addressing 3.5 Ethernet
3.7 PPP
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
Star topology
Bus topology popular through mid 90s Now star topology prevails Connection choices: hub or switch (more later)
hub or switch
Preamble: 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 used to synchronize receiver, sender clock rates
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
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
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
CSMA/CD efficiency
Tprop = max prop between 2 nodes in LAN
efficiency
1 1 5t pr op / ttr ans
Manchester encoding
Used in 10BaseT Each bit has a transition Allows clocks in sending and receiving nodes to
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
forwarding: move packets from routers input to appropriate router output routing: determine route taken by packets from source to dest.
routing algorithms
1
3 2
datagram network provides network-layer connectionless service analogous to the transport-layer services, but:
service: host-to-host implementation: in network core
Datagram networks
routers: no state about end-to-end connections
no network-level concept of connection
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
Network layer
forwarding table
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
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)
how much overhead with TCP? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead
reassembly
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
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
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
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.7.1
223.1.2.1
subnet part
host part
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
/etc/network/interfaces
DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server
plug-and-play
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
200.23.30.0/23
ISPs-R-Us Send me anything with addresses beginning 199.31.0.0/16
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
Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned
Names and Numbers
rest of Internet
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
Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual)
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
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
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
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
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
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.
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
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
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
Logical view:
A
IPv6
B
IPv6
tunnel
E
IPv6
F
IPv6
Physical view:
A
IPv6
B
IPv6
IPv4 IPv4
E
IPv6
F
IPv6
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
A-to-B: IPv6
E-to-F: IPv6
routing algorithm
1
3 2
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
w
3
1
- e.g., c(w,z) = 5
z
2
Static or dynamic?
Static: routes change slowly over time Dynamic: routes change more quickly periodic update in response to link cost changes
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
D(x),p(x) 1,u
D(y),p(y) 2,x
D(z),p(z)
5 2 1
v
2
3 3 1
w
1
z
2
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
A
0 0
1+e e
B
1
2+e
C
e
0 1
A
0 0
2+e
1+e
2+e
D 1+e 1 B e 0 C
initially
recompute
recompute
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
5 2 1
v
2
3 3 1
w
1
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)
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
node detects local link cost change updates routing info, recalculates distance vector if DV changes, notify neighbors
y
50
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.
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
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
Transport Layer
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
network data link physical application transport network data link physical
network data link physical application transport network data link physical
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
connectionless:
no handshaking between UDP sender, receiver each UDP segment handled independently of others
UDP: more
often used for streaming multimedia apps loss tolerant Length, in bytes of UDP rate sensitive
32 bits source port # dest port # checksum
DNS SNMP reliable transfer over UDP: add reliability at application layer application-specific error recovery!
length
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
TCP: Overview
point-to-point:
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
flow controlled:
socket door
Figure 12.1
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
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.
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
Stream delivery
Figure 12.3
Figure 12.4
TCP segments
Note: The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number.
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.
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.
32 bits
source port #
dest port #
sequence number
acknowledgement number
head len not used
UAP R S F
checksum
Host B
time
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
300
RTT (milliseconds)
250
200
150
first estimate of how much SampleRTT deviates from EstimatedRTT: DevRTT = (1-)*DevRTT + *|SampleRTT-EstimatedRTT| (typically, = 0.25) Then set timeout interval:
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
Host A
Host B
SendBase = 100
timeout
loss
Sendbase = 100 SendBase = 120
Seq=92 timeout
SendBase = 120
time
time
Lt Col Chandan Tiwari
premature timeout
Transport Layer 3-382
loss
Fast Retransmit
Time-out period often relatively long:
long delay before resending lost packet
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
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
speed-matching service: matching the send rate to the receiving apps drain rate
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
close
timed wait
closed
Transport Layer 3-390
closing
closed
Transport Layer 3-391
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
Causes/costs of congestion
two senders, two receivers one router
Host A
in : original data
out
Host B
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
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
16 Kbytes
8 Kbytes
time time
Lt Col Chandan Tiwari
Figure 12.36
Congestion example
Roughly,
rate = CongWin Bytes/sec RTT
How does sender perceive congestion? loss event = timeout or 3 duplicate acks TCP sender reduces rate (CongWin) after loss event
When connection begins, increase rate exponentially fast until first loss event
Host B
double CongWin every RTT done by incrementing CongWin for every ACK received
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
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:
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.
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.
Figure 12.21
Example 5
Note: To avoid shrinking the sender window, the receiver must wait until more space is available in its buffer.
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:
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
flow controlled:
socket door
Figure 11.1
Congestion control, pkt loss has to be taken care by the appln layer. 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.
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
APPLICATION LAYER
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
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
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
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
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 ...
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
By typing this in (hit carriage return twice), you send this minimal (but complete) GET request to HTTP server
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
server
server creates ID 1678 for user cookiespecific action cookiespectific action
Set-cookie: 1678
usual http request msg
cookie: 1678
usual http response 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
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.
Figure 19.1
FTP
Figure 19.2
Figure 19.3
Figure 19.5
Figure 19.6
Command processing
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)
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.
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.
Figure 19.8
Example 1
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.
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
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.
Figure 19.9
Example 3
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
TFTP
Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol without the sophisticated features of FTP.
Note: TFTP uses the services of UDP on the well-known port 69.
Figure 19.16
Connection establishment
Figure 19.18
Figure 19.19
TFTP example
Figure 19.20
DNS
Figure 17.2
Figure 17.4
Domains
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
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.
Resource records
Domain _name domain to which recored applies
TTL - expressed in seconds. Measure of stability and used in caching
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
Part of the DNS name space showing the division into zones.
TLD com DNS servers org DNS servers edu DNS servers
Authoritative
Lt Col Chandan Tiwari
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
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
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.
Example
Host at cis.poly.edu wants IP address for gaia.cs.umass.edu
2
requesting host
cis.poly.edu
gaia.cs.umass.edu
recursive query:
puts burden of name resolution on contacted name server heavy load?
2 7 3
6
TLD DNS server
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
gaia.cs.umass.edu
Figure 17.11
Recursive resolution
Figure 17.12
Iterative resolution
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
Type=MX
value is name of mailserver associated with name
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
Electronic Mail
Three major components: user agents mail servers simple mail transfer protocol: SMTP
user agent mail server
SMTP
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
header
blank line
body
body
the message, ASCII characters only
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
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).
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
encoded data
SMTP
SMTP
access protocol
user agent
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
Figure 20.1
First scenario
Note: When the sender and the receiver of an email are on the same system, we need only two user agents.
Figure 20.2
Second scenario
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).
Figure 20.3
Third scenario
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).
Figure 20.4
Fourth scenario
Figure 20.5
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
The topics discussed in this section include: Services Provided by a User Agent User Agent Types Sending Mail Receiving Mail Addresses Mailing List MIME
Figure 20.6
User agent
Note: Some examples of command-driven user agents are mail, pine, and elm
Note: Some examples of GUI-based user agents are Eudora, Outlook, and Netscape.
Figure 20.7
Format of an email
The topics discussed in this section include: Commands and Responses Mail Transfer Phases
Figure 20.13
SMTP range
Figure 20.14
Figure 20.15
Command format
Figure 20.19
Figure 20.20
POP3
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
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 Server
Proxy Server
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.
Figure 16.1
Figure 16.2
Figure 16.3
Figure 16.4
Figure 16.5
Option format
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
Note: DHCP provides static and dynamic address allocation that can be manual or automatic.
Figure 16.6
DHCP packet
Figure 16.7
Figure 16.8
Exchanging messages
NETWORK SECURITY
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
CRYPTOGRAPHY
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)
is asymmetric because
those who encrypt messages or verify signatures cannot decrypt messages or create signatures
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
Digital Signatures
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
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
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
E-Mail Security
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
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
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.
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.
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
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
IPSec
IPSec provides security at network (Internet) layer. Mandatory for next-generation IPv6, optional for current-generation (IPv4).
Network
Inner IP datagram
Header Payload
Security
Gateway
Inner IP datagram
Outer Header
Inner IP datagram
Header Payload
Outer Header
Header
Payload
VPN
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
Malicious Codes
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
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
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
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
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
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.
A Distributed Denial Of Service (DDoS) attack is a DoS attack multiplied by the number of attackers.
DDOS
Slave Master
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
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
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
Client (C)
Server (S)
Hostile
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.
FIREWALL
a choke point of control and monitoring interconnects networks with differing trust imposes restrictions on network services
only authorized traffic is allowed
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.
key goal often is to acquire passwords so then exercise access rights of owner
Lt Col Chandan Tiwari
rule-based detection
anomaly penetration identification
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
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
IEEE 802.11g Another variation IEEE 802.15 - Bluetooth IEEE 802.16 - WiMAX
Lt Col Chandan Tiwari
Two modes:
Basis Service Set (BSS) BSS with base stn. Base stn is also called an Access Point (AP)
Lt Col Chandan Tiwari
Because the range of a single radio may not cover the entire system.
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.
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
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
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.
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.
request to send
timer
clear to send
network allocation vector
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?
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)
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
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.
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.
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.
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.
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
$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 )
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.
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.
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.
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.
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.
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).
THANK YOU