0% found this document useful (0 votes)
201 views150 pages

EC2352 CN Notes - NPR

This document provides an introduction to computer networks. It discusses different types of networks including LAN, MAN and WAN. It describes common network topologies like bus, star, ring and mesh. It also discusses network components, physical media, networking devices, clients and servers. Network protocols like TCP/IP and applications of computer networks are outlined. The OSI model and its seven layers are briefly introduced.

Uploaded by

Karthick Vijayan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
201 views150 pages

EC2352 CN Notes - NPR

This document provides an introduction to computer networks. It discusses different types of networks including LAN, MAN and WAN. It describes common network topologies like bus, star, ring and mesh. It also discusses network components, physical media, networking devices, clients and servers. Network protocols like TCP/IP and applications of computer networks are outlined. The OSI model and its seven layers are briefly introduced.

Uploaded by

Karthick Vijayan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 150

www.Vidyarthiplus.

com

Computer networks

Subject code: EC2352 Year: III Unit: I Title: Introduction to computer networks CODED BY: M.KASI RAJAN AP / CSE

www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Computer Networks
Computer network connects two or more autonomous computers.

The computers geographically anywhere.

can be located

www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

LAN, MAN & WAN


Network in small geographical Area (Room, Building or a Campus) is called LAN (Local Area Network)

Network in a City is call MAN (Metropolitan Area Network)

Network spread geographically (Country or across Globe) is called WAN (Wide Area Network)

www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Applications of Networks
Resource Sharing Hardware (computing resources, disks, printers) Software (application software) Information Sharing Easy accessibility from anywhere (files, databases) Search Capability (WWW) Communication Email Message broadcast Remote computing Distributed processing (GRID Computing)
www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Network Topology
The network topology defines the way in which computers, printers, and other devices are connected. A network topology describes the layout of the wire and devices as well as the paths used by data transmissions.

www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Bus Topology
Commonly referred to as a linear bus, all the devices on a bus topology are connected by one single cable.

www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Star & Tree Topology


The star topology is the most commonly used architecture in Ethernet LANs. When installed, the star topology resembles spokes in a bicycle wheel. Larger networks use the extended star topology also called tree topology. When used with network devices that filter frames or packets, like bridges, switches, and routers, this topology significantly reduces the traffic on the wires by sending packets only to the wires of the destination host.
www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Ring Topology
A frame travels around the ring, stopping at each node. If a node wants to transmit data, it adds the data as well as the destination address to the frame. The frame then continues around the ring until it finds the destination node, which takes the data out of the frame. Single ring All the devices on the network share a single cable Dual ring The dual ring topology allows data to be sent in both directions.
www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Mesh Topology
The mesh topology connects all devices (nodes) to each other for redundancy and fault tolerance. It is used in WANs to interconnect LANs and for mission critical networks like those used by banks and financial institutions. Implementing the mesh topology is expensive and difficult.
www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Network Components
Physical Media Interconnecting Devices Computers Networking Software Applications

www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Networking Media
Networking media can be defined simply as the means by which signals (data) are sent from one computer to another (either by cable or wireless means).

www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Networking Devices
HUB, Switches, Wireless Access Modems etc. Routers, Points,

www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Computers: Clients and Servers


In a client/server network arrangement, network services are located in a dedicated computer whose only function is to respond to the requests of clients. The server contains the file, print, application, security, and other services in a central computer that is continuously available to respond to client requests.

www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Networking Protocol: TCP/IP

www.Vidyarthiplus.com

www.Vidyarthiplus.com Introduction to Computer Networks

Applications
E-mail Searchable Data (Web Sites) E-Commerce News Groups Internet Telephony (VoIP) Video Conferencing Chat Groups Instant Messengers Internet Radio

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Network Architecture
Provides a general, effective, fair, and robust connectivity of computers Provides a blueprint Types OSI Architecture Internet Architecture

www.Vidyarthiplus.com

www.Vidyarthiplus.com

OSI ARCHITECTURE
Open Systems Interconnection (OSI) model is a reference model developed by ISO (International Organization for Standardization) in 1984 OSI model defines the communications process into Layers Provides a standards for communication in the network Primary architectural model for inter-computing and Inter networking communications. network communication protocols have a structure based on OSI Model

www.Vidyarthiplus.com

www.Vidyarthiplus.com

OSI Architecture

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Direct Links: Outline


Physical Layer
Link technologies Encoding

Link Layer
Framing Error Detection Reliable Transmission (ARQ protocols) Medium Access Control:

Existing protocols: Ethernet, Token Rings, Wireless

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Link Technologies
Cables:
Cat 5 twisted pair, 10-100Mbps, 100m Thin-net coax, 10-100Mbps, 200m Thick-net coax, 10-100Mbps, 500m Fiber, 100Mbps-2.4Gbps, 2-40km

Leased Lines:
Copper based: T1 (1.544Mbps), T3 (44.736Mbps) Optical fiber: STS-1 (51.84Mbps), STS-N (N*51.84Mbps)

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Link Technologies
Last-Mile Links: POTS (56Kbps), ISDN (2*64Kbps) xDSL: ADSL (16-640Kbps, 1.554-8.448Mbps), VDSL (12.96Mbps55.2Mbps) CATV: 40Mbps downstream, 20Mbps upstream Wireless Links: Cellular, Satellite, Wireless Local Loop

www.Vidyarthiplus.com

www.Vidyarthiplus.com

FRAMING
An efficient data transmission technique It is a message forwarding system in which data packets, called frames, are passed from one or many start-points to one

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Approaches
Byte oriented Protocol(PPP)
BISYNC Binary Synchronous Communication DDCMP Digital Data Communication Message Protocol

Bit oriented Protocol(HDLC) Clock based Framing(SONET)

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Byte oriented Protocol(PPP)


BISYNC FRAME FORMAT SYH SYH SOH Header STX Body ETX CRC

PPP Frame Format Flag Address Control Protocol Payload Flag

www.Vidyarthiplus.com

www.Vidyarthiplus.com

DDCMP Frame Format

SYN

SYN

Class

Count

Header

Body

CRC

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Bit Oriented Protocol(HDLC)

Collection of Bits 1.HDLC High-Level Data Link Control 2.Closed Based Framing(SONET) Synchronous Optical Network

www.Vidyarthiplus.com

www.Vidyarthiplus.com

HDLC Frame Format


Beginning sequence Header Body CRC Ending sequence

Bit Stufffing After 5 consecutive 1s insert 0 Next bit is 0 stuffed removed Next bit is 1 end of frame or erorr

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Closed Based Framing(SONET)


STS-1 Frame
9 rows of 90 byte each First 3 byte for overhead rest contains data Payload bytes scrambled- exclusive OR Supports Multiplexing
Payloads

9 rows

90 columuns www.Vidyarthiplus.com

www.Vidyarthiplus.com

ERROR DETECTION
Detecting Errors In Transmission Electrical Interference, thermal noise Approaches Two Dimensional Parity Internet Checksum Algorithm Cyclic Redundancy Check

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Two Dimensional Parity


7 bits of data Number of 1s 0000000 (0) 1010001 (3) 1101001 (4) 1111111 (7) even 00000000 11010001 01101001 11111111 8 bits including parity odd 100000000 01010001 11101001 01111111

www.Vidyarthiplus.com

Transmission sent using even parity:


A wants to transmit: 1001 A computes parity bit value: 1^0^0^1 = 0 A adds parity bit and sends: 10010 B receives: 10010 B computes parity: 1^0^0^1^0 = 0 B reports correct transmission after observing expected even result.

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Transmission sent using odd parity:


A wants to transmit: 1001 A computes parity bit value: ~(1^0^0^1) = 1 A adds parity bit and sends: 10011 B receives: 10011 B computes overall parity: 1^0^0^1^1 = 1 B reports correct transmission after observing expected odd result.

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Reliable Transmission
Deliver Frames Reliably Accomplished by Acknowledgements and Timeouts ARQ-Automatic Repeat Request

Mechanism: Stop and Wait Sliding Window Concurrent Logical Channels


www.Vidyarthiplus.com

www.Vidyarthiplus.com

Stop And Wait ARQ


The source station transmits a single frame and then waits for an acknowledgement (ACK). Data frames cannot be sent until the destination stations reply arrives at the source station. It discards the frame and sends a negative acknowledgement (NAK) back to the sender causes the source to retransmit the damaged frame in case of error

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Acknowledgements & Timeouts


Sender Receiver Sender Receiver

Fram e
Timeout Timeout Time
ACK

Fram e
ACK

Fram e
Timeout
ACK

(a)

(c)

Sender

Receiver

Sender

Receiver

Fram e
Timeout Timeout

Fram e
ACK

Fram e
Timeout Timeout

Fram e
ACK

ACK

(b)

(d)

www.Vidyarthiplus.com

Stop & wait sequence numbers


Sender Receiver Sender Timeout imeout Receiver Sender Receiver Timeout

www.Vidyarthiplus.com

Timeout imeout

(c)

Timeout imeout

(d)

(e)

Simple sequence numbers enable the client to discard


duplicate copies of the same frame Stop & wait allows one outstanding frame, requires two distinct sequence numbers
www.Vidyarthiplus.com

www.Vidyarthiplus.com

Stop And Wait

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Sliding Window

bi-directional data transmission protocol used in the data link layer (OSI model) as well as in TCP

It is used to keep a record of the frame sequences sent respective acknowledgements received by both the users.

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Sliding Window: Sender


Assign sequence number to each frame (SeqNum) Maintain three state variables:
send window size (SWS) last acknowledgment received (LAR) last frame sent (LFS)

Maintain invariant: LFS - LAR <= SWS Advance LAR when ACK arrives SWS Buffer up to SWS frames

LAR LFS

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Sequence Number Space


SeqNum field is finite; sequence numbers wrap around Sequence number space must be larger then number of outstanding frames SWS <= MaxSeqNum-1 is not sufficient
suppose 3-bit SeqNum field (0..7) SWS=RWS=7 sender transmit frames 0..6 arrive successfully, but ACKs lost sender retransmits 0..6 receiver expecting 7, 0..5, but receives the original incarnation of 0..5

SWS < (MaxSeqNum+1)/2 is correct rule Intuitively, SeqNum slides between two halves of sequence number space

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Sliding Window: Receiver


Maintain three state variables
receive window size (RWS) largest frame acceptable (LFA) last frame received (LFR) Maintain invariant: LFA - LFR <= RWS RWS

LFR LFA

Frame SeqNum arrives:


if LFR < SeqNum < = LFA accept if SeqNum < = LFR or SeqNum > LFA discarded Send cumulative ACKs send ACK for largest frame such that all
frames less than this have been received

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Ehernet
local-area network (LAN) covered by the IEEE 802.3. two modes of operation:
half-duplex full-duplex modes. .

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Three basic elements : 1. the physical medium used to carry Ethernet signals between computers, 2. a set of medium access control rules embedded in each Ethernet interface that allow multiple computers to fairly arbitrate access to the shared Ethernet channel, 3. an Ethernet frame that consists of a standardized set of bits used to carry data over the system

www.Vidyarthiplus.com

www.Vidyarthiplus.com

IEEE 802.5 Format

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Frame Format IEEE 802.5

www.Vidyarthiplus.com

www.Vidyarthiplus.com

IEEE 802.3 MAC Data Frame Format

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Wireless
The process by which the radio waves are propagated through air and transmits data Wireless technologies are differentiated by :
Protocol Connection typePoint-to-Point (P2P) SpectrumLicensed or unlicensed

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Types
Infrared Wireless Transmission

Tranmission of data signals using infrared-light waves


Microwave Radio

sends data over long distances (regions, states, countries) at up to 2 megabits per second (AM/FM Radio)
Communications Satellites microwave relay stations in orbit around the earth.

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

UNIT III Packet Switching


Is a network communications method Groups all transmitted data, irrespective of content, type, or structure into suitably-sized blocks, called packets. Optimize utilization of available link capacity Increase the robustness of communication. When traversing network adapters, switches and other network nodes packets are buffered and queued, resulting in variable delay and throughput, depending on the traffic

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Types
Connectionless
each packet is labeled with a connection ID rather than an address. Example:Datagram packet switching

connection-oriented
each packet is labeled with a destination address Example:X.25 vs. Frame Relay

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Star Topology

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Source Routing
0 Switch 1 3 2 3 0 1 1 3 0 0 1 2 Switch 2 3 1 3 2 0 1

Host A 0 1 3 0 Switch 3 3 2 Host B

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Virtual Circuit Switching


Explicit connection setup (and tear-down) phase Subsequence packets follow same circuit Sometimes called connection-oriented model
3 0 Switch 1 1 2 5 11 3 2 Switch 2 1 0

Analogy: phone call Each switch maintains a VC table

Host A 7 1 0 Switch 3 3 4 2 Host B

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Datagram Switching
No connection setup phase Each packet forwarded independently Sometimes called connectionless model Host D

Analogy: postal system Each switch maintains a forwarding (routing) table

3 Host C

0 Switch 1 1 2 3

Host E Host F 2 Switch 2 1 0

Host A

Host G 1

0 Switch 3 Host B 3 2

Host H

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Virtual Circuit Model


Typically wait full RTT for connection setup before sending first data packet. While the connection request contains the full address for destination each data packet contains only a small identifier, making the per-packet header overhead small. If a switch or a link in a connection fails, the connection is broken and a new one needs to be established. Connection setup provides an opportunity to reserve resources.

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Datagram Model
There is no round trip delay waiting for connection setup; a host can send data as soon as it is ready. Source host has no way of knowing if the network is capable of delivering a packet or if the destination host is even up. Since packets are treated independently, it is possible to route around link and node failures. Since every packet must carry the full address of the destination, the overhead per packet is higher than for the connection-oriented model.

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Bridges and Extended LANs


LANs have physical limitations (e.g., 2500m) Connect two or more LANs with a bridge accept and forward strategy level 2 connection (does not add packet header)
A B C Port 1 Bridge Port 2

Ethernet Switch = Bridge on Steroids

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Spanning Tree Algorithm


Problem: loops
C D A B B3 B5 B2 E B7 F K

B1 G H

B6 I

B4 J

Bridges run a distributed spanning tree algorithm


select which bridges actively forward developed by Radia Perlman now IEEE 802.1 specification

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Algorithm Details
Bridges exchange configuration messages id for bridge sending the message id for what the sending bridge believes to be root bridge distance (hops) from sending bridge to root bridge Each bridge records current best configuration message for each port Initially, each bridge believes it is the root

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Algorithm Details
Bridges exchange configuration messages id for bridge sending the message id for what the sending bridge believes to be root bridge distance (hops) from sending bridge to root bridge Each bridge records current best configuration message for each port Initially, each bridge believes it is the root

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Thank U CODED BY: M.KASI RAJAN AP / CSE

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Computer networks

Subject code: EC2352 Year: III Unit: II Title: Introduction to network layers CODED BY: M.KASI RAJAN AP / CSE

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Internetworking
An internetwork is a collection of individual networks, connected by intermediate networking devices, that functions as a single large network. different kinds of network technologies that can be interconnected by routers and other networking devices to create an internetwork

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Types
Local-area networks (LANs)enabled multiple users in a relatively small geographical area to exchange files and messages, as well as access shared resources such as file servers and printers. Wide-area networks (WANs) interconnect LANs with geographically dispersed users to create connectivity. technologies used for connecting LANs include T1, T3, ATM, ISDN, ADSL, Frame Relay, radio links, and others.

www.Vidyarthiplus.com

www.Vidyarthiplus.com

ETH

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

IPV4 Packet Header


Version HLen Ident TTL Protocol TOS Length Flags Offset Checksum

SourceAddr Destination Addr Options(variable) Pad(variable) Data

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Datagram Delivery

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Packet Format

www.Vidyarthiplus.com

www.Vidyarthiplus.com

IPV4 Packet header

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Fragmentation and Reassembly

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Fragmentation and Reassembly

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Fragmentation and Reassembly

www.Vidyarthiplus.com

www.Vidyarthiplus.com

(RARP)Reverse Address Resolution Protocol


(RARP) is a Link layer networking protocol RARP is described in internet EngineeringTask ForceETF) publication RFC 903 It has been rendered obsolete by the Bootstrap Protocol (BOOTP) and the modern Dynamic Host Configuration Protocol(DHCP) BOOTP configuration server assigns an IP address to each client from a pool of addresses. BOOTP uses the User Datagram Protocol (UDP)

www.Vidyarthiplus.com

Routing

www.Vidyarthiplus.com

Router
A router is a device that determines the next network point to which a packet should be forwarded toward its destination Allow different networks to communicate with each other A router creates and maintain a table of the available routes and their conditions and uses this information to determine the best route for a given packet. A packet will travel through a number of network points with routers before arriving at its destination. There can be multiple routes defined. The route with a lower weight/metric will be tried first.

www.Vidyarthiplus.com

Routing

www.Vidyarthiplus.com

Routing

www.Vidyarthiplus.com

Routing

www.Vidyarthiplus.com

Routing Protocols
Static Routing Dynamic Routing
IGP (Interior Gateway Protocol): Route data within an Autonomous System RIP (Routing Information Protocol) RIP-2 (RIP Version 2) OSPF (Open Shortest Path First) IGRP (Interior Gateway Routing Protocol) EIGRP (Enhanced Interior Gateway Routing Protocol) IS-IS

EGP (Exterior Gateway Protocol): Route data between Autonomous


Systems BGP (Border Gateway Protocol)

www.Vidyarthiplus.com

www.Vidyarthiplus.com

The Routing Algorithm


u

the shortest path tree is contained in the routing table Calculations are based on the Bellman-Ford algorithm

Iskra Djonova-Popova www.Vidyarthiplus.com

The Centralized Version of the Algorithm


A 3 D 6 Cycle Initial 1 1 B 4 E Node B (., ) (1, 1) 2
1

www.Vidyarthiplus.com

C
3

A 4 D

5
E

C (., ) (2, 2)

D (., ) (3, 1)

E (., ) (4, 2)

Iskra Djonova-Popova www.Vidyarthiplus.com

www.Vidyarthiplus.com

The Distributed Version


A 1 2 B C From A to B C D E Link Cost 1 1 1 2 3 1 1 2 Routing table for A

3 6

4 5 D E

Example of simple network with 5 nodes (routers) and 6 links (interfaces) The cost of all links is assumed to be 1

Iskra Djonova-Popova www.Vidyarthiplus.com

www.Vidyarthiplus.com

Advantages
simple to implement low requirement in processing and memory at the nodes suitable for small networks

Iskra Djonova-Popova www.Vidyarthiplus.com

www.Vidyarthiplus.com

Disadvantages
Slow convergence Bouncing effect Counting to infinity problem

Iskra Djonova-Popova www.Vidyarthiplus.com

www.Vidyarthiplus.com

Slow Convergence
2 A XXX B C

3 6

4 5 D E

link 1 breaks

When a link breaks the routers are supposed to reestablish the routing tables

Iskra Djonova-Popova www.Vidyarthiplus.com

www.Vidyarthiplus.com

The Bouncing Effect


1 A B XXX C

3 6

4 5 D E

link 2 breaks and A sends its routing table to B before B sends it to A


Iskra Djonova-Popova www.Vidyarthiplus.com

www.Vidyarthiplus.com

Counting to Infinity Problems


2 A XXX B C

4 5 D XXX E

Links 1 and 6 break.

A sends its old routing table before D sends the new routing table
Iskra Djonova-Popova www.Vidyarthiplus.com

www.Vidyarthiplus.com

Subnets
Each organization assigns IP addresses to specific computers on its networks IP addresses are assigned so that all computers on the same LAN have similar addresses Each of these lans is known as a TCP/IP subnet Any portion of the IP address can be designated as a subnet using a subnet mask*
* Subnet masks tell computers what part of an IP address is to be used to determine whether a destination is on the same or a different subnet

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Subnet Addressing

www.Vidyarthiplus.com

Figure 5-6

www.Vidyarthiplus.com

Subnet Addressing
Example 1
Suppose that the first two bytes are the subnet indicator with addresses of the form 131.156.x.x Then, 131.156.29.156 and 131.156.34.215 would be on the same subnet. The subnet mask would be 255.255.0.0, which corresponds to 11111111.11111111.00000000.00000000, where 1 indicates that the position is part of the subnet address and a 0 indicates that it is not.

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Subnet Addressing
Example 2
Partial bytes can also be used as subnets. For example, consider the subnet mask 255.255.255.128, which is 11111111.11111111.11111111.10000000. Here, all computers with the same first three bytes and last byte from 128 to 254 would be on the same subnet.

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Providing Addresses
Providing addresses to networked computers
Static addressing Dynamic addressing

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Static Addressing
Each computer is given an address through a configuration file Stored on individual computers Problems
Moves, changes, adds and deletes Individuals could change their own IP address Network renumbered

Companies do not have a good way of tracking the addresses


www.Vidyarthiplus.com

www.Vidyarthiplus.com

Dynamic Addressing
Server supplies a network layer address automatically
Each time user logs in For a specific lease period

Two standards for dynamic addressing


Bootstrap protocol (bootp) - developed in 1985 Dynamic host control* protocol (DHCP), developed in 1993
* some say C = configuration

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Dynamic Addressing
Bootp and DHCP
Software installed on the client instructs the client to contact the server using data link layer addresses Message asks server to assign the client a unique network layer address Server runs corresponding software that sends the client its network address and subnet mask

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Leasing
Bootp or DHCP server can either:
Assign the same network layer address to the client each time the client requests it (bootp) Lease the network address from the next available on a list of authorized addresses for as long as the client is connected or for a specified amount of time -- common with isps and dial-up users (DHCP)

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Address Resolution
The process of:
Translating an application layer address to a network address (server name resolution) Translating the server name address to a data link layer address (data link layer address resolution)

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Address Resolution
Server name resolution
Accomplished by the use of domain name service (DNS) Computers called name servers provide these DNS services
Address data base includes: server names and their corresponding IP address

www.Vidyarthiplus.com

www.Vidyarthiplus.com
Weber State University
DNS Request Client computer DNS Response DNS Server sol.acs.unt.edu 137.90.2.122

LAN DNS Request

DNS Response Root DNS Server for .EDU domain

Internet
DNS Request

Northern Illinois University

DNS Server netmgr.cso.niu.edu 131.156.1.11 LAN DNS Response

Figure 5-7

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Address Resolution
Data link layer address resolution
Broadcast message is sent to all computers in its subnet
if your IP address is xxx.Yyy.Zzz.Ttt, please send your data link layer address Uses address resolution protocol (ARP)

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Network Routing
The process of determining the route a message will take through the network
Centralized Decentralized
Static routing Dynamic routing Broadcast or multicast routing

Connectionless Connection-oriented routing


www.Vidyarthiplus.com

www.Vidyarthiplus.com

Route and Route Table


B C Computer B Destination Route A C D E F G

G A

A C A E E C

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Internet Routes
WSU Canada Other destinations

UEN

Europe West Coast

Asia

WSU Destination Route UEN Utah Oxford Europe U of Toronto Canada U of Singapore Asia UC Stanford West Coast Other Other

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Types of Routing
Centralized routing Static routing (decentralized) Dynamic routing (adaptive and decentralized)
Distance vector Link state

Other types
Broadcast routing Multicast routing
www.Vidyarthiplus.com

www.Vidyarthiplus.com

Centralized Routing
All routing decisions are made by one computer Main routing for star and mesh topologies Routing tables located on each computer
Central computer sends updated tables as needed Routing table tells the device where to send messages

Simplicity - no wasted resources Hardware failures or changing conditions cause table to be out of sync
www.Vidyarthiplus.com

www.Vidyarthiplus.com

Decentralized Routing
Each of the following types of routing fall under the heading of decentralized routing Each device makes its own routing decisions with the use of a formal routing protocol Routing protocols are self-adjusting
Can automatically adapt to changes in the network configuration

Drawbacks
Slows down the network with status messages Requires more processing by each computer

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Static Routing
Routing table developed by the network manager or some type of committee
Initial table sent to each computer which then updates the routing table as needed Reroutes as needed with down or removed circuits Updated when new devices announce their presence Used in relatively static networks that have few routing options
www.Vidyarthiplus.com

www.Vidyarthiplus.com

Dynamic Routing (Adaptive)


Routing messages over the fastest route
Used when there are multiple routes in the network Improves network performance by selecting the fastest route to avoid bottlenecks or busy circuits Initial table developed by network manager Dynamically updated with changing conditions by the devices themselves Monitors message transmission time or each device reports how busy it is to avoid bottlenecks

Disadvantages
Requires more processing by each computer Wastes network capacity
www.Vidyarthiplus.com

www.Vidyarthiplus.com

Dynamic Routing (Adaptive)


Distance vector dynamic routing
The number of hops along a route Exchange information with the neighboring computers every few minutes

Link state dynamic routing


The number of hops along a route The speed of the circuits on the route How busy the route is Exchanges information with other routing devices every 15-30 minutes Tries to determine the fastest route Converges reliable routing information more quickly

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Routing Protocols
RIP, IGP, OSPF, EGP, BGP Distance vector routing protocols (RIP, Appletalk,IPX, IGRP)
Routers inform neighboring routers of table Closest router is used to route packets

Link State routing protocols (OSPF)


Routers have at least a partial map of the network Changes are flooded throughout network Routes are recomputed
www.Vidyarthiplus.com

www.Vidyarthiplus.com

Interior and Exterior Routing


Interior routing is within an autonomous system (collection of routers under a single administrative control)RIP, OSPF Exterior routing occurs between autonomous systems Network access protocols operate at Layer 2.
Transport of IP datagrams IP over point-to-point connections is used by ISP when you dial in
www.Vidyarthiplus.com

www.Vidyarthiplus.com

Routing Protocols
Border Gateway Protocol Internet Control Message Protocol Routing Information Protocol Open Shortest Path First Enhanced Interior Gateway Routing Protocol

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Routing Protocols
Internet protocols
BGP (border gateway protocol)
Exchanges information between autonomous systems about the condition of the internet Complex, hard to administer, exterior routing protocol

ICMP (internet control message protocol)


Simple, interior routing protocol used with the internet Reports routing errors but is limited in the ability to update

RIP (routing information protocol)


Dynamic distance vector interior routing protocol Counts the number of devices on each route Selects the route with the least number of devices
www.Vidyarthiplus.com

www.Vidyarthiplus.com

Routing Protocols
OSPF (open shortest path first)
Link state interior routing protocol used on the internet Counts number of computers, network traffic, network error rates to select the best route Doesnt broadcast to all devices just to routing devices Preferred TCP/IP, but also used by IPX/SPX

EIGRP (enhanced interior gateway routing protocol)


Link state interior routing protocol developed by CISCO Uses route transmission capacity, delay, reliability and load to select best route Stores multiple routing tables

SAP (service advertisement protocol)


Netware servers send SAP advertisements Novells broadcast protocol
www.Vidyarthiplus.com

www.Vidyarthiplus.com

Broadcast Routing
Sends the message to all computers on the network Only computer with correct address processes the message Used only in bus networks Wastes network bandwidth

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Multicasting
Similar to broadcasting Only works within one LAN or subnet Messages sent from one computer to another on the network is called a unicast message Messages sent to a group of computers is called a multicast message Targeting a specific work group IGMP (internet group management protocol)
Sends an IGMP multicast request to the routing computer Assigned a special class D IP address to identify the group The routing computer sets the data link layer address All participating machines will process messages sent to this address Sends a IGMP message notifying of end of session

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Thank U CODED BY: M.KASI RAJAN AP / CSE

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Computer networks

Subject code: EC2352 Year: III Unit: III Title: Introduction to Transport layer CODED BY: M.KASI RAJAN AP / CSE

www.Vidyarthiplus.com

www.Vidyarthiplus.com

TCP Overview

www.Vidyarthiplus.com

www.Vidyarthiplus.com

End to end issues

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Segment format

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Connection establishment

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

TCP sliding window

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Stream control Transmission Protocol

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Simple demultiplexor

www.Vidyarthiplus.com

www.Vidyarthiplus.com

TCP Congestion Control


Determines the network capacity Adjust the number of packets that can have safely in transit Acks to pace the transmission of packets TCP is self clocking Avoids congestion Maxwindow=MIN(CongestionWindow,AdvertisedWindow) EffectiveWindow=MaxWindow-(LastByteSent-LastByteAcked)

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Caused By
the shortage of buffer space. slow links. slow processors Possible solutions
End-to-end versus link-by-link control Rate-Based versus Credit-Based control The rate-based traffic-flow technique constantly Integrated congestion control

Integrated congestion control

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Principles of Congestion Control


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

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Scenario 1: Queuing Delays


Host A

two senders, two receivers one router, infinite buffers no retransmission

lin : original data

lout

Host B

unlimited shared output link buffers

large delays when congested maximum achievable throughput


www.Vidyarthiplus.com

www.Vidyarthiplus.com

Scenario 2: Retransmits
one router, finite buffers sender retransmission of lost packet
Host A
lin : original data l'in : original data, plus retransmitted data

lout

Host B

finite shared output link buffers

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Scenario 3: Congestion Near Receiver


four senders multihop paths timeout/retransmit
Host A

Q: what happens as and lincrease ?


in
lin : original data l'in : original data, plus retransmitted data lout

in

finite shared output link buffers

Host B

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Approaches towards congestion control


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

Network-assisted congestion control:


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

www.Vidyarthiplus.com

www.Vidyarthiplus.com

TCP Congestion Control


end-end control (no network assistance) sender limits transmission:
LastByteSent-LastByteAcked CongWin

Roughly,
CongWin Bytes/sec CongWin is dynamic, RTT function of rate =

perceived network congestion

How does sender perceive congestion? loss event = timeout or 3 duplicate acks TCP sender reduces rate (CongWin) after loss event three mechanisms:
AIMD slow start conservative after timeout events

www.Vidyarthiplus.com

www.Vidyarthiplus.com

TCP AIMD
multiplicative decrease: cut CongWin in half after loss event
congestion window 24 Kbytes

additive increase: increase CongWin by 1 MSS every RTT in the absence of loss events: probing

16 Kbytes

8 Kbytes

time

Long-lived TCP connection


www.Vidyarthiplus.com

www.Vidyarthiplus.com

TCP Slow Start


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

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

available bandwidth may be >> MSS/RTT


desirable to quickly ramp up to respectable rate

www.Vidyarthiplus.com

www.Vidyarthiplus.com

TCP Slow Start (more)


When connection begins, increase rate exponentially until first loss event: double CongWin every RTT done by incrementing CongWin for every ACK received Summary: initial rate is slow but ramps up exponentially fast
Host A Host B

RTT

time

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Refinement (more)
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
www.Vidyarthiplus.com

www.Vidyarthiplus.com

TCP sender congestion control


Event ACK receipt for previously unacked data ACK receipt for previously unacked data Loss event detected by triple duplicate ACK Timeout State Slow Start (SS) TCP Sender Action CongWin = CongWin + MSS, If (CongWin > Threshold) set state to Congestion Avoidance CongWin = CongWin+MSS * (MSS/CongWin) Commentary Resulting in a doubling of CongWin every RTT

Congestio n Avoidance (CA) SS or CA

Additive increase, resulting in increase of CongWin by 1 MSS every RTT Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS. Enter slow start

Threshold = CongWin/2, CongWin = Threshold, Set state to Congestion Avoidance Threshold = CongWin/2, CongWin = 1 MSS, Set state to Slow Start

SS or CA

Duplicate ACK

SS or CA

Increment duplicate ACK CongWin and Threshold not changed count for segment being www.Vidyarthiplus.com acked

www.Vidyarthiplus.com

Congestion Avoidance Mechanisms


Helps to avoid congestion Additional functionality into the router to assist in anticipation of congestion to control congestion once it happens to repeatedly increase load in an effort to find the point at w hich congestion occurs, and then back off

www.Vidyarthiplus.com

www.Vidyarthiplus.com

Mechanisms
router-centric: DECbit and RED Gateways host-centric: TCP Vegas

www.Vidyarthiplus.com

www.Vidyarthiplus.com

DECbit

www.Vidyarthiplus.com

www.Vidyarthiplus.com

DECbit
Add binary congestion bit to each packet header Router monitors average queue length over last busy+idle cycle set congestion bit if average queue length greater than 1 w hen packet arrives attempts to balance throughput against delay

www.Vidyarthiplus.com

www.Vidyarthiplus.com

DECbit
End Hosts destination echos bit back to source source records how many packets resulted in set bit if less than 50% of last window's worth had bit set, then increase C ongestionWindow by 1 packet if 50% or more of last window's worth had bit set, then decrease C ongestionWindow by 0.875 times

www.Vidyarthiplus.com

www.Vidyarthiplus.com

UDPUser Datagram Protocol


An unreliable, connectionless transport layer protocol UDP format. See picture Two additional functions beyond IP:
Demultiplexing: deliver to different upper layer entities such as DNS, RTP, SNMP based on the destination port # in the header. i.e., UDP can support multiple applications in the same end systems. (Optionally) check the integrity of entire UDP. (recall IP only checks the integrity of IP header.)
If source does not want to compute checksum, fill checksum with all 0s. If compute checksum and the checksum happens to be 0s, then fill all 1s. UDP checksum computation is similar to IP checksum, with two more:
Add extra 0s to entire datagram if not multiple of 16 bits. Add pseudoheader to the beginning of datagram. UDP pseudoheader www.Vidyarthiplus.com
147

www.Vidyarthiplus.com

UDP datagram

0 Source Port UDP Length

16 Destination Port UDP Checksum Data

31

Back to UDPUser Datagram Protocol


www.Vidyarthiplus.com
Figure 8.16

148

www.Vidyarthiplus.com

Back to UDPUser Datagram Protocol

UDP pseudoheader
0 8 16 Source IP Address Destination IP Address 00000000 Protocol = 17 UDP Length 31

1.Pseudoheader is to ensure that the datagram has indeed reached the correct destination host and port. 2. The padding of 0s and pseudoheader is only for the computation of checksum and not be transmitted.

www.Vidyarthiplus.com

Figure 8.17

149

www.Vidyarthiplus.com

Thank U CODED BY: M.KASI RAJAN AP / CSE

www.Vidyarthiplus.com

You might also like