Upload
api-26312742
View
253
Download
2
Tags:
Embed Size (px)
Citation preview
UTTAM K. ROY
Dept. of Information Technology,
Jadavpur University, Kolkata
INTERNETWORKINGINTERNETWORKING
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
2
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
• Andrew S. Tanenbaum, “Computer Networks”, Prentice Hall of India publication
• Alberto Leon Garcia & Indra Widjaja, “Communication Networks”, Tata McGraw-Hill publication
• William Stallings, “Data & Computer Communications”, Prentice Hall of India publication
• Krouse, “Computer Networks”, Pearson publication
BooksBooks
• Farouzan, “Computer Networks”
• Farouzan, “TCP/IP Protocol Suit”
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
3
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IntroductionIntroduction Definition
Collection of (autonomous) computers connected by some fashion Example
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
4
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advantages of Computer NetworksAdvantages of Computer Networks Resource Sharing:
Expensive resources (Database, high-speed laser printer, array processors) can be shared among users of different sites as they are connected to one another. Example
• World Wide Web(WWW) • File Transfer Protocol(FTP)• Domain Name System• Network File System• Database• Remote login
Computation/Productivity speedup: Concurrent execution of independent tasks using cluster Example
• Parallel Binary search • Matrix multiplication • Load balancing
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
5
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advantages of Computer NetworksAdvantages of Computer Networks Reliability/Availability/Fault Tolerant:
Entire system does not go down if a part becomes faulty Example
• Introduction of secondary DNS• Distributed database
(Inter-process)Communication: Processes running at different computers can communicate Example
• Remote Procedure Call• Socket
Incremental growth: Avoid huge initial setup cost
Improved Control/Flexibility: Facility to control the system remotely
Responsiveness:
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
6
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Communications ModelCommunications Model Source
generates data to be transmitted—telephones, PC
Transmitter Converts data into transmittable signals—Modem
Transmission System Carries data
Receiver Converts received signal into data Example
• Modem
Destination Takes incoming data
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
7
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Key Communications TasksKey Communications Tasks Transmission System Utilization
Efficient use of shared medium Example
• Multiplexing—FDM, TDM, WDM• Congestion control
Interfacing Interfacing with transmission medium—electromagnetic signal propagation
Signal Generation Form and intensity such that
• Capable of being propagated • Interpretable at receiver
Synchronization Determining beginning and ending of signals and its duration
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
8
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Key Communications TasksKey Communications Tasks Exchange Management
Cooperation(Convention) between communicating parties• Format and direction(simplex, duplex)
Error detection and correction Signals are distorted before they reach at the destination Some tasks can not tolerate error—FTP
Recovery Next step to the error detection
Flow Control Fast transmitter/slow receiver problem
Addressing and routing Identifying network devices
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
9
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Key Communications TasksKey Communications Tasks Message formatting
Agreement between two parties—binary code for characters
Security Sender wish to be assured that intended receiver gets data Receiver must be sure that the data have not been altered in transit Receiver must be sure that the data come from purported sender not from intruder
Network Management Configuration Monitor its status Responds on failure and overloads
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
10
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Simplified Data Communications ModelSimplified Data Communications Model
Protocol Architecture
Protocol Architecture
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
12
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ProtocolsProtocols High degree of cooperation is needed between two computer systems Used for communications between entities in a system Must speak the same language Entities
User applications e-mail facilities terminals
Systems Computer Terminal Remote sensor
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
13
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ProtocolsProtocols Key elements of a Protocol
Syntax• Data formats• Signal levels
Semantics• Control information• Error handling
Timing• Speed matching• Sequencing
Standardized protocol Needed to promote interoperability among vendor equipment
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
14
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
OSI ModelOSI Model Open Systems Interconnection Developed by the International Organization for Standardization (ISO) in 1977 Seven layers
Application Presentation Session Transport Network Data Link Physical
A theoretical system delivered too late! TCP/IP is the de facto standard
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
15
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
OSI ModelOSI Model Physical Layer
Physical interface between data transmission device (e.g. computer) and transmission medium or network Characteristics of transmission medium
• Mechanical—connector type• Electrical—signal levels • Functional—function of individual cuircits• Procedural—sequence of events,data rates etc.
Data Link Layer Error detection and correction Flow control
Network Access Layer Exchange of data between end system and network Destination address provision Routing functions across multiple networks
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
16
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
OSI ModelOSI Model Transport Layer
Connection oriented and connectionless service Reliable delivery of data Sequencing/Ordering of delivery Avoid duplication
Session Layer Dialog Discipline—full duplex or half duplex Recovery—check pointing mechanisms
Presentation Later Format/presentation/syntax of data
Application Layer Provides user interface such as file transfer (FTP), electronic mail(SMTP), remote login(Telnet/SSH/rlogin), WWW(http) etc.
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
17
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
TCP/IP Protocol ArchitectureTCP/IP Protocol Architecture Developed by the US Defense Advanced Research Project Agency (DARPA) for its packet switched network (ARPANET) Used by the global Internet No official model but a working one.
Application layer Host to host or transport layer Internet layer Network access layer Physical layer
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
18
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
OSI v TCP/IPOSI v TCP/IP
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
19
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
TCP/IP Protocol Architecture ModelTCP/IP Protocol Architecture Model
Data Transmission
Data Transmission
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
21
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Transmission TerminologyTransmission Terminology Transmitter Receiver Medium
Guided medium• e.g. twisted pair, optical fiber
Unguided medium• e.g. air, water, vacuum
Direct link No intermediate devices Point-to-point
• Only 2 devices share link Multi-point
• More than two devices share the link
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
22
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Simplex One direction
• e.g. Television
Half duplex Either direction, but only one way at a time
• e.g. police radio
Full duplex Both directions at the same time
• e.g. telephone
Transmission TerminologyTransmission Terminology
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
23
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Frequency, Spectrum and BandwidthFrequency, Spectrum and Bandwidth Time domain concepts
Continuous signal• Various in a smooth way over time
Discrete signal• Maintains a constant level then changes to another constant level
Periodic signal• Pattern repeated over time
Aperiodic signal• Pattern not repeated over time
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
24
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Continuous & Discrete SignalsContinuous & Discrete Signals
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
25
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Periodic SignalsPeriodic Signals
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
26
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Sine WaveSine Wave Peak Amplitude (A)
maximum strength of signal volts
Frequency (f) Rate of change of signal Hertz (Hz) or cycles per second Period = time for one repetition (T) T = 1/f
Phase () Relative position in time
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
27
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Varying Sine WavesVarying Sine Waves
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
28
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
WavelengthWavelength
Distance occupied by one cycle Distance between two points of corresponding phase in two consecutive cycles Assuming signal velocity v
= vT f = v c = 3*108 ms-1 (speed of light in free space)
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
29
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Frequency Domain ConceptsFrequency Domain Concepts Signal usually made up of many frequencies Components are sine and/or cosine waves Can be shown (Fourier analysis) that any signal is made up of component sine and/or cosine waves Can plot frequency domain functions
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
30
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Addition of Frequency ComponentsAddition of Frequency Components
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
31
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Frequency DomainFrequency Domain
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
32
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Spectrum & BandwidthSpectrum & Bandwidth Spectrum
range of frequencies contained in signal
Absolute bandwidth width of spectrum
Effective bandwidth Often just bandwidth Narrow band of frequencies containing most of the energy
DC Component Component of zero frequency
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
33
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Signal with DC ComponentSignal with DC Component
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
34
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Data Rate and BandwidthData Rate and Bandwidth
Any transmission system has a limited band of frequencies
This limits the data rate that can be carried
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
35
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Analog and Digital Data TransmissionAnalog and Digital Data Transmission Data
Entities that convey meaning
Signals Electric or electromagnetic representations of data
Transmission Communication of data by propagation and processing of signals
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
36
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
DataData
Analog Continuous values within some interval e.g. sound, video
Digital Discrete values e.g. text, integers
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
37
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Acoustic Spectrum (Analog)Acoustic Spectrum (Analog)
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
38
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
SignalsSignals Means by which data are propagated Analog
Continuously variable Various media
• wire, fiber optic, space Speech bandwidth 100Hz to 7kHz Telephone bandwidth 300Hz to 3400Hz Video bandwidth 4MHz
Digital Use two DC components
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
39
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Data and SignalsData and Signals Usually use digital signals for digital data and analog signals for analog data Can use analog signal to carry digital data
Modem
Can use digital signal to carry analog data Compact Disc audio
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
40
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Analog Signals Carrying Analog and Digital DataAnalog Signals Carrying Analog and Digital Data
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
41
© Copyright 2007, U. K. Roy, IT, JU
InternetworkingDigital Signals Carrying Analog and Digital
DataDigital Signals Carrying Analog and Digital
Data
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
42
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Analog TransmissionAnalog Transmission Analog signal transmitted without regard to content May be analog or digital data Attenuated over distance Use amplifiers to boost signal Also amplifies noise
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
43
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Digital TransmissionDigital Transmission Concerned with content Integrity endangered by noise, attenuation etc. Repeaters used Repeater receives signal Extracts bit pattern Retransmits Attenuation is overcome Noise is not amplified
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
44
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advantages of Digital TransmissionAdvantages of Digital Transmission
Digital technology Low cost LSI/VLSI technology
Data integrity Longer distances over lower quality lines
Capacity utilization High bandwidth links economical High degree of multiplexing easier with digital techniques
Security & Privacy Encryption
Integration Can treat analog and digital data similarly
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
45
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Transmission ImpairmentsTransmission Impairments Signal received may differ from signal transmitted Analog - degradation of signal quality Digital - bit errors Caused by
Attenuation and attenuation distortion Delay distortion Noise
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
46
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
AttenuationAttenuation Signal strength falls off with distance Depends on medium Exponential in nature Issues
Received signal strength:• must be enough to be detected• must be sufficiently higher than noise to be received without error
Attenuation is an increasing function of frequency• Use equalization
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
47
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Delay DistortionDelay Distortion
Only in guided media Propagation velocity varies with frequency
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
48
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Noise Noise Additional signals inserted between transmitter and receiver Thermal (Also called white noise)
Due to thermal agitation of electrons Uniformly distributed
Intermodulation Signals that are the sum and difference of original frequencies sharing a medium
Crosstalk A signal from one line is picked up by another
Impulse Irregular pulses or spikes e.g. External electromagnetic interference Short duration High amplitude
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
49
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Channel CapacityChannel Capacity Data rate
In bits per second Rate at which data can be communicated
Bandwidth In cycles per second of Hertz Constrained by transmitter and medium
Nyquist Bandwidth Establishes data rate and bandwidth for noise free channel Given M signal levels and B bandwidth, maximum data rate C that can be achieved is
C = 2Blog2M Shannon’s Capacity
Given signal to noise ratio SNR, maximum data rate
C = B log2(1 + SNR)
Transmission MediaTransmission Media
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
51
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
OverviewOverview Guided - wire Unguided - wireless Characteristics and quality determined by medium and signal For guided, the medium is more important For unguided, the bandwidth produced by the antenna is more important Key concerns are data rate and distance
Advanced Java Programming
04/08/23 09:1204/08/23 09:12
52
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Design FactorsDesign Factors Bandwidth
Higher bandwidth gives higher data rate
Transmission impairments Attenuation
Interference Number of receivers
In guided media More receivers (multi-point) introduce more attenuation
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
53
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Electromagnetic SpectrumElectromagnetic Spectrum
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
54
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Guided Transmission MediaGuided Transmission Media
Twisted Pair Coaxial cable Optical fiber
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
55
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Twisted PairTwisted Pair
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
56
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Twisted Pair - ApplicationsTwisted Pair - Applications Most common medium Telephone network
Between house and local exchange (subscriber loop)
Within buildings To private branch exchange (PBX)
For local area networks (LAN) 10Mbps or 100Mbps
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
57
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Twisted Pair - Pros and ConsTwisted Pair - Pros and Cons Cheap Easy to work with Low data rate Short range
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
58
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Twisted Pair - Transmission CharacteristicsTwisted Pair - Transmission Characteristics
Analog Amplifiers every 5km to 6km
Digital Use either analog or digital signals repeater every 2km or 3km
Limited distance Limited bandwidth (1MHz) Limited data rate (100MHz) Susceptible to interference and noise
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
59
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Unshielded and Shielded TPUnshielded and Shielded TP Unshielded Twisted Pair (UTP)
Ordinary telephone wire Cheapest Easiest to install Suffers from external EM interference
Shielded Twisted Pair (STP) Metal braid or sheathing that reduces interference More expensive Harder to handle (thick, heavy)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
60
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
UTP CategoriesUTP Categories Cat 3
up to 16MHz Voice grade found in most offices Twist length of 7.5 cm to 10 cm
Cat 4 up to 20 MHz
Cat 5 up to 100MHz Commonly pre-installed in new office buildings Twist length 0.6 cm to 0.85 cm
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
61
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Near End CrosstalkNear End Crosstalk Coupling of signal from one pair to another Coupling takes place when transmit signal entering the link couples back to
receiving pair i.e. near transmitted signal is picked up by near receiving pair
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
62
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Coaxial CableCoaxial Cable
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
63
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Coaxial Cable ApplicationsCoaxial Cable Applications
Most versatile medium Television distribution
Ariel to TV Cable TV
Long distance telephone transmission Can carry 10,000 voice calls simultaneously Being replaced by fiber optic
Short distance computer systems links Local area networks
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
64
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Coaxial Cable - Transmission CharacteristicsCoaxial Cable - Transmission Characteristics
Analog Amplifiers every few km Closer if higher frequency Up to 500MHz
Digital Repeater every 1km Closer for higher data rates
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
65
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optical FiberOptical Fiber
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
66
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optical Fiber - BenefitsOptical Fiber - Benefits
Greater capacity Data rates of hundreds of Gbps
Smaller size & weight Lower attenuation Electromagnetic isolation Greater repeater spacing
10s of km at least
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
67
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optical Fiber - ApplicationsOptical Fiber - Applications Long-haul trunks Metropolitan trunks Rural exchange trunks Subscriber loops LANs
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
68
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optical Fiber - Transmission CharacteristicsOptical Fiber - Transmission Characteristics Act as wave guide for 1014 to 1015 Hz
Portions of infrared and visible spectrum
Light Emitting Diode (LED) Cheaper Wider operating temp range Last longer
Injection Laser Diode (ILD) More efficient Greater data rate
Wavelength Division Multiplexing
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
69
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optical Fiber Transmission ModesOptical Fiber Transmission Modes
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
70
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Wireless TransmissionWireless Transmission Unguided media Transmission and reception via antenna Directional
Focused beam Careful alignment required
Omnidirectional Signal spreads in all directions Can be received by many antennae
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
71
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
FrequenciesFrequencies
2GHz to 40GHz Microwave Highly directional Point to point Satellite
30MHz to 1GHz Omnidirectional Broadcast radio
3 x 1011 to 2 x 1014
Infrared Local
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
72
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Terrestrial MicrowaveTerrestrial Microwave Parabolic dish Focused beam Line of sight Long haul telecommunications Higher frequencies give higher data rates
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
73
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Satellite MicrowaveSatellite Microwave Satellite is relay station Satellite receives on one frequency, amplifies or repeats signal and transmits on another frequency Requires geo-stationary orbit
Height of 35,784km
Television Long distance telephone Private business networks
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
74
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Broadcast RadioBroadcast Radio Omnidirectional FM radio UHF and VHF television Line of sight Suffers from multipath interference
Reflections
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
75
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
InfraredInfrared Modulate noncoherent infrared light Line of sight (or reflection) Blocked by walls e.g. TV remote control, IRD port
Data EncodingData Encoding
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
77
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Encoding TechniquesEncoding Techniques Data are not generally transmitted as they are due to:
Framing Error detection and correction
Data are converted into transmittable signals There are two possibilities
Analog communication• Analog data, analog signal
• Telephone system• Digital data, analog signal
• Computer to computer communication using telephone line Digital Communication
• Digital data, digital signal• Analog data, digital signal
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
78
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Digital Data, Digital SignalDigital Data, Digital Signal Digital signal
Discrete, discontinuous voltage pulses Each pulse is a signal element Binary data encoded into signal elements
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
79
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
TerminologyTerminology Unipolar
All signal elements have same sign
Polar One logic state represented by positive voltage the other by negative voltage
Data rate Rate of data transmission in bits per second
Bit duration or length of a bit Time taken for transmitter to emit the bit
Modulation rate Rate at which the signal level changes Measured in baud = signal elements per second
Mark and Space Binary 1 and Binary 0 respectively
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
80
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Interpreting SignalsInterpreting Signals Need to know
Timing of bits - when they start and end Signal levels
Factors affecting successful interpreting of signals Signal to noise ratio Data rate Bandwidth
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
81
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Comparison of Encoding SchemesComparison of Encoding Schemes Signal Spectrum
• Lack of high frequencies reduces required bandwidth• Lack of dc component allows ac coupling via transformer, providing isolation• Concentrate power in the middle of the bandwidth
Clocking• Synchronizing transmitter and receiver
• External clock• Sync mechanism based on signal
Error detection• Can be built in to signal encoding
Signal interference and noise immunity• Some codes are better than others
Cost and complexity• Higher signal rate (& thus data rate) lead to higher costs• Some codes require signal rate greater than data rate
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
82
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Encoding SchemesEncoding Schemes Non-Return to Zero
Non-Return to Zero-Level (NRZ-L) Non-Return to Zero Inverted (NRZ-I)
Multilevel Binary Bipolar -AMI Pseudoternary
Biphase Manchester Differential Manchester
Scrambling B8ZS HDB3
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
83
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Two different voltages for 0 and 1 bits Voltage constant during bit interval
no transition i.e. no return to zero voltage
e.g. Absence of voltage for zero, constant positive voltage for one More often, negative voltage for one value and positive for the other Example
Non-Return to Zero Level (NRZ-L)Non-Return to Zero Level (NRZ-L)
0 1 0 0 1 1 0 0 0 1 1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
84
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Differential EncodingDifferential Encoding Data represented by changes rather than levels More reliable detection of transition rather than level In complex transmission layouts it is easy to lose sense of polarity
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
85
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Non-Return to Zero Inverted(NRZ-I)Non-Return to Zero Inverted(NRZ-I) Non-return to zero inverted on ones Constant voltage pulse for duration of bit Data encoded as presence or absence of signal transition at beginning of bit time Transition (low to high or high to low) denotes a binary 1 No transition denotes binary 0 An example of differential encoding
0 1 0 0 1 1 0 0 0 1 1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
86
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
NRZ pros and consNRZ pros and cons Pros
Easy to engineer Make good use of bandwidth
Cons dc component Lack of synchronization capability Lack of error detection/correction facility
Used for magnetic recording Not often used for signal transmission
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
87
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Multilevel BinaryMultilevel Binary Use more than two levels Bipolar-AMI
zero represented by no line signal one represented by positive or negative pulse alternatively one pulses alternate in polarity
Pros No loss of sync if a long string of ones (zeros still a problem) No net dc component Lower bandwidth Easy error detection
0 1 0 0 1 1 0 0 0 1 1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
88
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
PseudoternaryPseudoternary One represented by absence of line signal Zero represented by alternating positive and negative No advantage or disadvantage over bipolar-AMI
0 1 0 0 1 1 0 0 0 1 1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
89
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bipolar-AMI and PseudoternaryBipolar-AMI and Pseudoternary
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
90
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Trade Off for Multilevel BinaryTrade Off for Multilevel Binary Not as efficient as NRZ
Each signal element only represents one bit In a 3 level system could represent log23 = 1.58 bits Receiver must distinguish between three levels
(+A, -A, 0) Requires approx. 3dB more signal power for same probability of bit error
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
91
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
BiphaseBiphase Manchester
Transition in middle of each bit period Transition serves as clock and data Low to high represents one High to low represents zero Used by IEEE 802.3
0 1 0 0 1 1 0 0 0 1 1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
92
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
BiphaseBiphase Differential Manchester
Midbit transition is clocking only Transition at start of a bit period represents zero No transition at start of a bit period represents one Note: this is a differential encoding scheme Used by IEEE 802.5
0 1 0 0 1 1 0 0 0 1 1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
93
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Biphase Pros and ConsBiphase Pros and Cons Pros
Synchronization on mid bit transition (self clocking) No dc component Error detection
• Absence of expected transition
Con At least one transition per bit time and possibly two Maximum modulation rate is twice NRZ Requires more bandwidth
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
94
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ScramblingScrambling Use scrambling to replace sequences that would produce constant voltage Filling sequence
Must produce enough transitions to sync Must be recognized by receiver and replace with original Same length as original
No dc component No long sequences of zero level line signal No reduction in data rate Error detection capability
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
95
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
B8ZSB8ZS Bipolar With 8 Zeros Substitution Based on bipolar-AMI If octet of all zeros and last voltage pulse preceding was positive encode as 000+-0-+ If octet of all zeros and last voltage pulse preceding was negative encode as 000-+0+- Causes two violations of AMI code Unlikely to occur as a result of noise Receiver detects and interprets as octet of all zeros
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
96
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
HDB3HDB3 High Density Bipolar 3 Zeros Based on bipolar-AMI String of four zeros replaced with one or two pulses
Number of Bipolar pulses(ones) since last substitution
Polarity of preceding pulse
Odd Even
- 000- +00+
+ 000+ -000-
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
97
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
B8ZS and HDB3B8ZS and HDB3
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
98
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bandwidth ComparisonBandwidth Comparison
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
99
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Modulation RateModulation Rate
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
100
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Modulation RateModulation Rate
Minimum 10101010… Maximum
NRZ-L 0 (all 0s or 1s) 1.0 1.0
NRZ-I 0 (all 0s) 0.5 1.0 (all 1s)
Bipolar AMI 0 (all 0s) 1.0 1.0
Pseudoternary 0 (all 1s) 1.0 1.0
Manchester 1.0 (10101…) 1.0 2.0 (all 0s or 1s)
Differential manchester
1.0 (all 1s) 1.5 2.0 (all 0s)
Data Link LayerData Link Layer
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
102
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Services provided to the Network Layer Unacknowledged connectionless service Acknowledged connectionless service Acknowledged connection-oriented service
Accessing of underlying medium (MAC sub-layer) Data Link Control(Data Link Control Sub-layer) Framing
Identify beginning and ending of a frame
Error Detection & Correction Identifying transmission errors and if possible correction
Error Control What to do if frames/acknowledgements are damaged/lost?
Flow Control Transmitter and Receiver must be synchronized
Data Link Layer Design IssuesData Link Layer Design Issues
Medium Access Control Sub-layer
Medium Access Control Sub-layer
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
104
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IntroductionIntroduction
LLC sub-layer
MAC sub-layerData Link Layer
Physical Layer
Network Layer
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
105
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IntroductionIntroduction Channel
Unicast—single user
Broadcast—sometimes called multi-access/random access channels
Key issue in a broadcast network determine who gets to use the channel when there is
competition for it
the protocols used to determine who goes next on a multiaccess channel belong to a sublayer of the data link layer called the MAC (Medium Access Control) sublayer.
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
106
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Two schemes exist to solve the problem of allocation
for a single broadcast channel among competitive
users: static channel allocation
dynamic channel allocation
The traditional way of allocating a single channel Frequency Division Multiplexing Access(FDMA)
• Each station is allocated its own frequency
• Uneven usage of bandwidth if number of senders is large and
continuously varying
Time Division Multiplexing Access (TDMA)
• Each station is allocated its own time slot for transmission
Statistical Time Division Multiplexing Access (STDMA)
Combination of FDMA and TDMA
Channel Allocation ProblemChannel Allocation Problem
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
107
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Problems of Static AllocationProblems of Static Allocation FDMA, TDMA are inherently inefficient
C=channel capacity in bps
=frame arrival rate in frames/sec
1/=mean frame size (random/Poison distribution)
Mean time delay from queueing theory
)()/
1
NNC C
N TFDMA = = = NT
The mean delay for FDMA or TDMA is N times worse
C
1T =
For FDMA
For TDMA
)()/
1
NNC C
N TTDMA = = = NT
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
108
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Five key assumptions:1. station model
1. N number of independent stations.
2. Frame generation rate is proportional to t is t
3. Blocks after a frame generation until it is transmitted
2. single channel 1. Only one channel is available for all stations
3. collision assumption1. Collision can occur. Every station can detect collision
4a. continuous time
4b. slotted time
5a. carrier sense Sense the carrier before transmission
5b. no carrier sense transmit without sensing the carrier
Dynamic Channel AllocationDynamic Channel Allocation
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
109
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ALOHAALOHA Pure ALOHA
Slotted ALOHA
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
110
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Pure ALOHAPure ALOHA
If collision occurs, detect it
wait a random amount of time and
retransmit
A station transmits a frame whenever it has
one
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
111
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Efficiency of Pure ALOHAEfficiency of Pure ALOHA Frame time—time required to transmit a single
frame
S=mean number of frame generated per frame time (Poision)
G=mean number of frames (old and new combined) transmitted
P0=probability that a frame does not suffer a collision
Throughput S=GP0
Probability the k frames are generated during a given frame time by Poisson distribution:
!K
eGP
Gk
k
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
112
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Efficiency of Pure ALOHAEfficiency of Pure ALOHA
GeP 0
GGeS 2 Throughpu
t 5.02
1max Gwith
eS Maximum
throughput Out of 100 frames, maximum of 18 frames reach
their destination without collision
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
113
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Slotted ALOHASlotted ALOHA Time is divided into discrete intervals
Transmission of a frame is only allowed at
the beginning of a slot
If a frame is generated in the middle of a
slot, the station must wait for the next slot
GGeS Throughpu
t 1
1max Gwith
eS Maximum
throughput
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
114
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Throughput of ALOHAThroughput of ALOHA
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
115
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Throughput of ALOHAThroughput of ALOHA
GkGG
k kk eeekkPE
1
1 1
)1(
Probability that a frame will avoid collision is e-G
Probability that a frame will suffer a collision is (1-e-
G)
Probability of a transmission requires exactly k
attempts is
Pk= e-G (1-e-G)k-1
Expected number of transmission
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
116
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
• Protocols in which stations listen for a carrier and act accordingly are called carrier sense protocols
• Persistent CSMA• If the channel is busy, station waits until it becomes idle (it
continually senses the carrier for the purpose of seizing it)
• Non-Persistent CSMA• If the channel is busy, station waits random amount of time
and repeats the algorithm
• 1-persistent CSMA• If the channel is idle, the station transmits with a probability
of 1• If collision occurs, it waits a random amount of time, and
starts all over again
• p-persistent• applies to slotted channels, when the station becomes
ready to send, it senses the channel, if it is idle, it transmits with a probability p
CSMA ProtocolsCSMA Protocols
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
117
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
• If collision occurs, stop transmission immediately
CSMA/CD ProtocolCSMA/CD Protocol
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
118
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
CollisionCollision
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
119
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Collision DetectionCollision Detection
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
120
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
CSMA/CD ProtocolCSMA/CD Protocol
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
121
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance ComparisonPerformance Comparison
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
122
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Collision Free ProtocolsCollision Free Protocols Collision adversely affect system performance,
when cable is long and frames short and number of
stations is large
Collision free protocols is the solution Bit-Map Protocol
Binary Countdown
Basic Assumptions N number of stations
Each station has a unique address from 0 to N-1
Which station gets the channel next?
Reservation protocols.
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
123
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bit-Map ProtocolBit-Map Protocol Basic Steps
Contention period Frame transmission
Contention slot has exactly N slots one for each station
Station j is allowed to transmit (either 1 or 0) during slot j
No other station is allowed to transmit during that slot
Station j sends a 1 if it has frame to transmit, 0 otherwise
After N time slots, each station has complete knowledge of which stations wish to transmit
Since every station agrees on who goes next, there will never be collision
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
124
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bit-Map ProtocolBit-Map Protocol
If a station is ready, after its bit slot, it must wait for next bit map
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
125
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance of Bit-Map ProtocolPerformance of Bit-Map Protocol Assumptions
Duration of each contention bit slot is unity Duration of a data frame is d time units
High numbered stations must wait on the average 0.5N slots
Low numbered stations must wait on the average 1.5N slots
mean for all stations is N slots
For low load, the overhead per frame is N bits, and the amount of data is d bits, for an efficiency of d/(N+d).
For high load, the overhead per frame is 1 bit, and the amount of data is Nd bits, for an efficiency of d/(d+1)
Average waiting time per frame is N/2+Nd/2=N(d+1)/2
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
126
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Binary Countdown ProtocolBinary Countdown Protocol 1 bit overhead per station in Bit-Map protocol
Solution Use binary station address
Basic idea A station with highest address will be allowed to
transmit All addresses are assumed to be same length Stations broadcast their address bits in each slot,
stating with high order bit The bits are then BOOLEAN ORed If a station sending a 0, gets 1 (this means that
there is at least one station with higher address), it gives up
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
127
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Binary Countdown ProtocolBinary Countdown Protocol
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
128
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
• The channel efficiency of this method, under low load is d/(d+ lnN).
• The channel efficiency of this method, under high load is Nd/(Nd+ lnN).
Efficiency of Binary Countdown ProtocolEfficiency of Binary Countdown Protocol
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
129
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Starvation may occur
Solution proposed by Mok and Ward Station having virtual address will be permuted
circularly
Example C, H, D, A, G, B, E, F have priorities 7, 6, 5, 4, 3, 2, 1,
0 If D transmits, it will removed from this order and
put at the end giving a priority order C, H, D, A, G, B, E, F, D
Problems of Binary Countdown ProtocolProblems of Binary Countdown Protocol
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
130
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance ComparisonPerformance Comparison
Two basic protocols Contention Contention free
Two performance measures Delay Channel efficiency
Contention protocols are preferable at low load
Contention free protocols are preferable at high load
Solution is Limited Contention Protocol
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
131
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Symmetric ProtocolSymmetric Protocol k number of stations
Each has a probability p of transmitting during each slot
Probability that some station will successfully acquire the channel during a given slot is A=kp(1-p)k-1
pmax= 1/k
Amax=(1-1/k)k-1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
132
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Symmetric ProtocolSymmetric Protocol
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
133
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Limited Contention ProtocolLimited Contention Protocol Probability of channel acquisition can be increased
by reducing competition Basic idea
Divide the station into groups At slot 0, members of group 0 is permitted to
transmit If one of them succeeds, it transmits If slot 0 is empty or there is collision, members of
group 1 contend for slot 1, etc. By making appropriate division, amount of
contention can be reduced. Choice
Each group has one member—contention free protocols
All station are in single group—ALOHA/Slotted ALOHA
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
134
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Adaptive Tree Walk ProtocolAdaptive Tree Walk Protocol Number of members in a group a dynamically
changed Example
All station are allowed to transmit at slot 0 If there is no collision, next slot 1 will be used by all
stations again Otherwise, stations will be broken into two groups
each having half number of stations. Slot 1 will be used by members of first half etc.
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
135
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ExampleExample
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
136
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
• Each node at level I has a fraction 2-i of the stations below it
• if the q ready stations are uniformly distributed, the expected number of them below a specific node at level i is just 2-iq
• the optimum level to begin searching the tree is at i=log2q
ImprovementImprovement
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
137
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Further ImprovementFurther Improvement G and H want to transmit At slot 0, collision will occur, slot 1 will be idle It is pointless to probe node 3 (because collision will
be the obvious result)
Data Link ControlSub-layer
Data Link ControlSub-layer
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
139
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
FramingFraming
message
message
message
12
132
12
3
3
TotalDelay TD
S A B D
Time
Propagation delay
S A B D
Time
TotalDelay
TD
Transmission delay
Breaks the message into number of segments called frames
This is done to reduce total transmission time
reduce amount of retransmission due to error
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
140
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optimal Number of frames?Optimal Number of frames?
inedmterdebetopacketsofnumberp
delaynpropagatioptratedataR
ndestinatioandsourcebetweenhopsofnumberklengthheaderh
messagetheinbitsofnumberx
R
hpx
ft
R
hpx
p
t f
1
S A B D
Time
TD
tp
2
31
2
3
1
2
3tf
tm
R
hpx
ptm
pD ktR
hpx
kR
hpx
p
T
)1(
hkx
pdpdTD )1(
0
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
141
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Expected amount of transmission?Expected amount of transmission?
xb)1( xb)1(1
xix bb )1(])1(1[ )1(
xrx
i
i
xixrx
bN
bbiN
)1(
1
)1(])1(1[1
)1(
x bit message b=bit error
rate Probability that the message will not be in error is
Probability that the message will be in error is
Probability that the message requires exactly i transmission for successful transmission [i.e. (i-1) unsuccessful transmission followed by successful transmission] is Expected number of transmission
Total number of bits transmitted without framing
xb
x
)1(
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
142
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Expected amount of transmission?Expected amount of transmission?
)/(
/
)1(
1
)1(
)1(
pxx
x
px
b
b
b
ingframwithdtransmittebitsofnumber
ingframwithoutdtransmittebitsofnumber
pxpx b
x
b
pxp
// )1()1(
)/(
p=number of frames
Expected number of transmission
Number of bits transmitted with framing
pxrp bN
/)1(
1
x=10,000 bits p=10 b=0.001 (1 out of 1000) ω= 8139
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
143
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
four methods for framing are: character count
starting and ending characters
starting and ending flags
physical layer coding violations
FramingFraming
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
144
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Character CountCharacter Count Assumes character oriented data transmission This method uses a field in the header to specify the
number of characters in the frame When data link layer at the destination sees this, it
knows how many characters follow
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
145
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Starting and ending charactersStarting and ending characters Gets around the problem of resynchronization Each frame starts with special ASCII character sequence DLE
STX and ends with the sequence DLE ETX DLE is Data Link Escape, STX is Start of TeXt and ETX is End of
TeXt If destination ever loses track of frame boundaries, all it has to
do is look for DLE STX or DLE ETX to figure out where it is
DLE STX A DLEB D ETX DLE STX D B DLE ETX
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
146
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Starting and ending charactersStarting and ending characters Problem occurs when data contains DLE STX or DLE ETX
DLE STX A DLEDLE D ETX Data sent by network layer
DLE STX A DLEDLE D ETXDLEData after being character stuffed by data link layer
DLE STX A DLEDLE D ETXData passed to network layer on the receiving node
Solution Sender’s data link layer inserts an ASCII DLE character just
before an “accidental” DLE character in the data This technique is called character stuffing
Data link layer at receiving end removes the DLE character Thus framing DLE STX or DLE ETX can be distinguished by
absence or presence of a single DLE as DLEs in the data are always doubled
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
147
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bit Stuffing
Starting and ending flagsStarting and ending flags
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
148
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
The data link layer breaks the bit stream up into
discrete frames and then computes the checksum for
each frame
when a frame arrives at the destination the checksum is
recomputed, and if it is different from the one contained
in the frame, the data link layer knows that an error has
occurred
Error DetectionError Detection
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
149
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Error DetectionError Detection
Additional bits added by transmitter for error detection
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
150
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Error Detection TechniquesError Detection Techniques Parity
Value of parity bit is such that character has even (even parity) or odd (odd parity) number of ones
Even number of bit errors goes undetected
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
151
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Two-dimensional parityTwo-dimensional parity
1 0 1 0 1 1
1 1 0 1 1 0
0 1 1 1 0 1
0 0 1 0 1 0
Undetected
error
Detected error
DetectableDouble-bit-
error
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
152
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Cyclic Redundancy Check(CRC)Cyclic Redundancy Check(CRC) For a block of d bits transmitter generates r bit
sequence Transmit d+r bits which is exactly divisible by some
predetermined number G Receiver divides frame by G
If no remainder, no error
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
153
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Cyclic Redundancy Check (CRC)Cyclic Redundancy Check (CRC)
QG
RRQ
G
R
G
RQ
G
RD
G
T
RDTr
r
2.
2.
D=d-bit data G=(r+1)-bit predetermined divisor F=r-bit FCS to be determined T=(d+r)-bit message to be transmitted
G
RQ
G
D r
2.
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
154
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ExampleExampleD=1010001101
G=110101
R=? 1 1 0 1 0 1|1 0 1 0 0 0 1 1 0 1 0 0 0 0 0
1 1 0 1 0 1 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 1 1 0 1 1 0 1 0 1
1 0 1 1 0 0 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 1 0 1 0 1 1 1
0
G
R
T=101000110101110
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
155
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
D=101110
G=1001
R=?
ExampleExample
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
156
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Error Correcting codesError Correcting codes
m-bit message k redundant bits are added T=(m+k)-bit message to be transmitted No of possible code words with (m+k)-bit is 2m+k
Out of 2m+k possible code words, only 2m code words
are valid Remaining code words are invalid Example
M=2, K=2 No. of possible codewords is 24 =16 No. of valid code words is 4
• 0000, 0011, 1100, 1111
No. of invalid code words is 12
0000 0100
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
157
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
•Hamming codes can correct single errors
•by arranging them into matrix we can correct burst errors
Error CorrectionError Correction
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
158
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
159
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
The polynomial code (cyclic redundancy code or CRC
code) are used for error detecting
when the polynomial code method is employed, the
sender and receiver must agree upon a generator
polynomial, G(x), in advance.
Both high and low bits of the generator must be 1
to compute the checksum for some frame with m bits,
corresponding to the polynomial M(x), the frame must
be longer than the generator polynomial
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
160
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
The algorithm for computing the checksum is as follows:
let r be the degree of G(x). Append r zero bits to the
low-order end of the frame, so it now contains m+r
bits and corresponds to the polynomial xrM(x)
divide the bit string corresponding to G(x) into the bit
string corresponding to xrM(x) using modulo 2 division
subtract the remainder (which is always r or fewer
bits) from the bit string corresponding to xrM(x) using
modulo 2 subtraction. The result is the checksummed
frame to be transmitted. Call its polynomial T(x).
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
161
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Flow ControlFlow Control Receiver may be slower than transmitter Transmitter must not transmit frames at a rate faster than the receiver can receive Ensuring the sending entity does not overwhelm the receiving entity
Preventing buffer overflow
Transmission time Time taken to emit all bits into medium
Propagation time Time for a bit to traverse the link
timeontransmissitimenpropagatio
a
If transmission time is normalized to 1, propagation time is `a`
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
162
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Model of Frame TransmissionModel of Frame Transmission
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
163
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Stop and WaitStop and Wait Source transmits frame Destination receives frame and replies with acknowledgement Source waits for ACK before sending next frame Destination can stop flow by not sending ACK Works well for a few large frames
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
164
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
FragmentationFragmentation Large block of data may be split into small frames
Limited buffer size Errors detected sooner (when whole frame received) On error, retransmission of smaller frames is needed Prevents one station occupying medium for long periods
Stop and wait becomes inadequate
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
165
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
frame
prop
frame
prop
propframe
frame
t
tawhere
a
t
t
tt
t
timenpropagatiotimeontransmissi
211
21
1
2
TD=tframe+tprop+tproc+tack+tprop+tpr
oc
TD≈tframe+2tprop
ack1
1
ack1
2
ack2
tframe
tprop
tproc
tack
Stop and Wait Link UtilizationStop and Wait Link Utilization
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
166
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Stop and Wait Link UtilizationStop and Wait Link Utilization
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
167
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
tprop=271 ms 1 kb frame 1 Mbps data rate Frame transmission time tframe=1 ms a=271 η= 1/(1+2x271)=0.00184
Stop and Wait Link UtilizationStop and Wait Link Utilization
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
168
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Sliding Window Flow ControlSliding Window Flow Control Allow multiple frames to be in transit at a time Receiver has buffer W long Transmitter can send up to W frames without ACK Each frame is numbered ACK includes number of next frame expected Sequence number bounded by size of field (k)
Frames are numbered modulo 2k
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
169
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Sliding Window DiagramSliding Window Diagram
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
170
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Example Sliding WindowExample Sliding Window
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
171
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Sliding Window EnhancementsSliding Window Enhancements Receiver can acknowledge frames without permitting further transmission (Receive Not Ready) Must send a normal acknowledge to resume If duplex, use piggybacking
If no data to send, use acknowledgement frame If data but no acknowledgement to send, send last acknowledgement number again, or have ACK valid flag (TCP)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
172
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Error ControlError Control Detection and correction of errors Lost frames Damaged frames Automatic repeat request
Error detection Positive acknowledgment Retransmission after timeout Negative acknowledgement and retransmission
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
173
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Automatic Repeat Request (ARQ)Automatic Repeat Request (ARQ) Stop and wait Go back N Selective reject (selective retransmission)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
174
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Stop and WaitStop and Wait Source transmits single frame Wait for ACK If received frame damaged, discard it
Transmitter has timeout If no ACK within timeout, retransmit
If ACK damaged,transmitter will not recognize it Transmitter will retransmit Receive gets two copies of frame Use ACK0 and ACK1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
175
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Stop and Wait -DiagramStop and Wait -Diagram
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
176
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Stop and Wait - Pros and ConsStop and Wait - Pros and Cons Simple Inefficient
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
177
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go Back N Go Back N Based on sliding window If no error, ACK as usual with next frame expected Use window to control number of outstanding frames If error, reply with rejection
Discard that frame and all future frames until error frame received correctly Transmitter must go back and retransmit that frame and all subsequent frames
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
178
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go Back N - Damaged FrameGo Back N - Damaged Frame Receiver detects error in frame i Receiver sends rejection-i Transmitter gets rejection-i Transmitter retransmits frame i and all subsequent
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
179
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go Back N - Lost Frame (1)Go Back N - Lost Frame (1) Frame i lost Transmitter sends i+1 Receiver gets frame i+1 out of sequence Receiver send reject i Transmitter goes back to frame i and retransmits
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
180
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go Back N - Lost Frame (2)Go Back N - Lost Frame (2) Frame i lost and no additional frame sent Receiver gets nothing and returns neither acknowledgement nor rejection Transmitter times out and sends acknowledgement frame with P bit set to 1 Receiver interprets this as command which it acknowledges with the number of the next frame it expects (frame i ) Transmitter then retransmits frame i
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
181
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go Back N – Damaged AcknowledgementGo Back N – Damaged Acknowledgement Receiver gets frame i and send acknowledgement (i+1) which is lost Acknowledgements are cumulative, so next acknowledgement (i+n) may arrive before transmitter
times out on frame i If transmitter times out, it sends acknowledgement with P bit set as before This can be repeated a number of times before a reset procedure is initiated
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
182
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go Back N - Damaged RejectionGo Back N - Damaged Rejection
As for lost frame (2)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
183
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go Back N - DiagramGo Back N - Diagram
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
184
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Maximum window size?Maximum window size? Consider a piggybacking acknowledgement scheme is used 3-bit sequence number Transmitter sends frame 0 and gets RR1 Transmitter then sends 1, 2, 3, 4, 5, 6, 7, 0 Transmitter gets RR1 What does it mean?
All eight frames are received properly All are lost and receiver is repeating its previous RR1
For n bit sequence number maximum window size can be 2n-1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
185
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Selective Reject/RetransmissionSelective Reject/Retransmission Only rejected frames are retransmitted Subsequent frames are accepted by the receiver and buffered Minimizes retransmission Receiver must maintain large enough buffer More complex login in transmitter
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
186
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Selective Reject -DiagramSelective Reject -Diagram
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
187
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Maximum window size?Maximum window size? Transmitter sends frame 0 through 6 All 7 frames are received properly. Receiver advances its window to accept frames 7 through 5 and sends RR7 RR7 is lost in transit. Transmitter times out and retransmit frame 0 Receiver accepts this frame as new frame
For n bit sequence number maximum window size can be 2n-1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
188
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?Performance?
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
189
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?Performance?
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
190
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?Performance?
aNa
N
aNU
2121
211
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
191
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?Performance?
)2( pfr
f
TTN
TU
t
f
T
TU Channel
Utilization Where Tf=time to transmit a single frame
Tt=total time that line is engaged in the transmission of a single frame
For error free operation using Stop-and-Wait protocol
pf
f
TT
TU
2
In the presence of error equation must be modified as
Where Nr=expected number of transmission for a frame
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
192
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?Performance?
p
11
p=probability that a single frame is in error
Assume ACKs and NAKs are never in error
To transmit a frame successfully, it requires exactly i attempts
That means i-1 times unsuccessful (with error) transmission followed by 1 successful (without error) transmission
Probability that a frame requires exactly i transmission is pi-1(1-p)
Nr=E[transmission]=
1
1 )1(i
i pip
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
193
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?Performance?
ap
U21
1 Stop-and-Wait ARQ
aNapN
aNpU
2121
)1(
211 Selective Reject ARQ
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
194
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go-back-N?Go-back-N? Nr=E[number of transmitted frame to transmit one frame
successfully]
f(i)=total number of transmission if original frame must be transmitted i times
K=total number of frames retransmitted (including the original frame) for each error
f(i)=1+(i-1)K =(1-K)+Ki
pKpp
pK
K
pipKppK
ppKiKN
i
i
i
i
i
ir
11
1)1(
)1()1()1(
)1(])1[(
1
1
1
1
1
1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
195
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go-back-N?Go-back-N?
NKaN
NppapN
aKaNapp
U,21
)1)(21()1(
21,2121
1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
196
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?Performance?
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
197
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
High Level Data Link ControlHigh Level Data Link Control
Widely used data link control protocol
Basic Characteristics Three types of stations Two link configurations Three data transfer mode
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
198
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
HDLC Station TypesHDLC Station Types Primary station
Controls operation of link Maintains separate logical link to each secondary station Frames issued are called commands
Secondary station Operates under control of primary station Frames issued called responses
Combined station May issue commands and responses
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
199
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
HDLC Link ConfigurationsHDLC Link Configurations Unbalanced
One primary and one or more secondary stations Supports full duplex and half duplex
Balanced Two combined stations Supports full duplex and half duplex
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
200
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
HDLC Transfer ModesHDLC Transfer Modes Normal Response Mode (NRM)
• Unbalanced configuration• Host computer as primary, Terminals as secondary • Primary initiates transfer to secondary• Secondary may only transmit data in response to command
from primary• Used on multi-drop lines
Asynchronous Balanced Mode (ABM)• Balanced configuration• Either station may initiate transmission without receiving
permission• Most widely used• No polling overhead
Asynchronous Response Mode (ARM)• Unbalanced configuration• Secondary may initiate transmission without permission form
primary• Primary responsible for line• rarely used
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
201
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Frame StructureFrame Structure Uses synchronous transmission All transmissions in frames Single frame format for all data and control exchanges
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
202
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Flag FieldsFlag Fields Delimit frame at both ends 01111110 May close one frame and open another Receiver hunts for flag sequence to synchronize Bit stuffing used to avoid confusion with data containing 01111110
0 inserted after every sequence of five 1s If receiver detects five 1s it checks next bit If 0, it is deleted If 1 and seventh bit is 0, accept as flag If sixth and seventh bits 1, sender is indicating abort
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
203
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bit StuffingBit Stuffing
Example with possible errors
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
204
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Address FieldAddress Field Identifies secondary station that will send or will receive frame Usually 8 bits long May be extended to multiples of 7 bits
LSB of each octet indicates that it is the last octet (1) or not (0)
All ones (11111111) is broadcast
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
205
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Control FieldControl Field Different for different frame type
Information - data to be transmitted to user (next layer up)• Flow and error control piggybacked on information frames
Supervisory - ARQ when piggyback not used Unnumbered - supplementary link control
First one or two bits of control filed identify frame type Remaining bits explained later
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
206
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Control Field DiagramControl Field Diagram
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
207
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Supervisory framesSupervisory frames
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
208
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Unnumbered framesUnnumbered frames
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
209
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Poll/Final BitPoll/Final Bit Use depends on context Command frame
P bit 1 to solicit (poll) response from peer
Response frame F bit 1 indicates response to soliciting command
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
210
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Information FieldInformation Field Only in information and some unnumbered frames Must contain integral number of octets Variable length
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
211
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Frame Check Sequence FieldFrame Check Sequence Field FCS Error detection 16 bit CRC Optional 32 bit CRC
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
212
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
HDLC OperationHDLC Operation Exchange of information, supervisory and unnumbered frames Three phases
Initialization Data transfer Disconnect
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
213
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Examples of Operation (1)Examples of Operation (1)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
214
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Examples of Operation (2)Examples of Operation (2)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
215
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Other DLC Protocols (LAPB,LAPD)Other DLC Protocols (LAPB,LAPD) Link Access Procedure, Balanced (LAPB)
Part of X.25 (ITU-T) Subset of HDLC - ABM Point to point link between system and packet switching network node
Link Access Procedure, D-Channel ISDN (ITU-D) ABM Always 7-bit sequence numbers (no 3-bit) 16 bit address field contains two sub-addresses
• One for device and one for user (next layer up)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
216
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Other DLC Protocols (LLC)Other DLC Protocols (LLC) Logical Link Control (LLC)
IEEE 802 Different frame format Link control split between medium access layer (MAC) and LLC (on top of MAC) No primary and secondary - all stations are peers Two addresses needed
• Sender and receiver Error detection at MAC layer
• 32 bit CRC Destination and source access points (DSAP, SSAP)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
217
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Other DLC Protocols (Frame Relay)Other DLC Protocols (Frame Relay) Streamlined capability over high speed packet witched networks Used in place of X.25 Uses Link Access Procedure for Frame-Mode Bearer Services (LAPF) Two protocols
Control - similar to HDLC Core - subset of control
ABM 7-bit sequence numbers 16 bit CRC 2, 3 or 4 octet address field
Data link connection identifier (DLCI) Identifies logical connection
More on frame relay later
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
218
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Other DLC Protocols (ATM)Other DLC Protocols (ATM) Asynchronous Transfer Mode Streamlined capability across high speed networks Not HDLC based Frame format called “cell” Fixed 53 octet (424 bit) Details later
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
219
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Required ReadingRequired Reading Stallings chapter 7
Web sites on HDLC, frame relay, Ethernet and ATM
Local Area Networks(LANs)
Local Area Networks(LANs)
IEEE802.3 (Ethernet) LAN
IEEE802.3 (Ethernet) LAN
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
222
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Ethernet CablingEthernet Cabling
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
223
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Ethernet TopologyEthernet Topology
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
224
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
EncodingEncoding
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
225
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Ethernet Frame formatEthernet Frame format
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
226
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Collision detectionCollision detection
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
227
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Ethernet EfficiencyEthernet Efficiency
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
228
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Switched Ethernet LANSwitched Ethernet LAN
IEEE802.4 (Token Bus) LAN
IEEE802.4 (Token Bus) LAN
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
230
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IEEE Standard 802.4
Token BusToken Bus
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
231
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Token Bus Frame FormatToken Bus Frame Format
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
232
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Token Bus Control FramesToken Bus Control Frames
IEEE802.5 (Token Ring) LAN
IEEE802.5 (Token Ring) LAN
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
234
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IEEE Standard 802.5: Token Ring
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
235
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
236
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
238
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
239
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
240
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Token Ring Frame FormatToken Ring Frame Format
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
241
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Token Ring Control FramesToken Ring Control Frames
Wide Area Networks(WANs)
Wide Area Networks(WANs)
IEEE802.6 (DQDB) LAN
IEEE802.6 (DQDB) LAN
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
244
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Network LayerNetwork Layer
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
246
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
The network layer is concerned with getting packets from all the way to the destination.
The network layer is the lowest layer that deals with end-to-end transmission
the network layer provides services to the transport layer at the network layer/transport layer interface.
The network layer services have been designed with the following goals in mind: The services should be independent of the subnet
technology the transport layer should be shielded from the
number, the type and the topology of the subnets present
the network addresses made available to the transport layer should use a uniform numbering plan, even across LANs and WANs.
Network Layer Design IssuesNetwork Layer Design Issues
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
247
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
248
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
249
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
250
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
251
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
In most subnets packets have to take multiple hops
the algorithms that choose the routes and the data structures that they use are a major area of network layer design
the routing algorithm that is a part of the network layer software responsible for deciding which output line an incoming packet should be transmitted on
In session routing route remains in force for an entire user session
Routing AlgorithmsRouting Algorithms
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
252
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Routing AlgorithmsRouting Algorithms Characteristics required
Correctness Simplicity Robustness Stability Fairness Optimality Efficiency
Performance Criteria Used for selection of route Minimum hop Least cost
Decision Time and Place Time
• Packet or virtual circuit basis
Place• Distributed
• Made by each node• Centralized• Source
Routing Strategies Non-adaptive
• Flooding• Random
Adaptive
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
253
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
FloodingFlooding No network info required Packets are sent by source node to every neighbor Incoming packets are retransmitted on every link except incoming link Eventually a number of copies will arrive at destination
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
254
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Flooding ExampleFlooding Example
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
255
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Properties of FloodingProperties of Flooding All possible routes are tried
Very robust
At least one packet will have taken minimum hop count route Can be used to set up virtual circuit
All nodes are visited Useful to distribute information (e.g. routing)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
256
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Disadvantage of FloodingDisadvantage of Flooding Huge number of packets will be generated Solution
Each packet is uniquely numbered so duplicates can be discarded Nodes can remember packets already forwarded to keep network load in bounds Can include a hop count in packets
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
257
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Random RoutingRandom Routing Node selects one outgoing path for retransmission of incoming packet Selection can be random or round robin Can select outgoing path based on probability calculation No network info needed Route is typically not least cost nor minimum hop
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
258
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Adaptive RoutingAdaptive Routing Used by almost all packet switching networks Routing decisions change as conditions on the network change
Failure Congestion
Requires info about network Decisions more complex Tradeoff between quality of network info and overhead Reacting too quickly can cause oscillation Too slowly to be relevant
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
259
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Adaptive Routing - AdvantagesAdaptive Routing - Advantages Improved performance Aid congestion control (See chapter 12) Complex system
May not realize theoretical benefits
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
260
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ClassificationClassification Based on information sources
Local (isolated)• Route to outgoing link with shortest queue• Can include bias for each destination• Rarely used - do not make use of easily available info
Adjacent nodes All nodes
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
261
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Isolated Adaptive RoutingIsolated Adaptive Routing
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
262
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ARPANET Routing Strategies(1)ARPANET Routing Strategies(1) First Generation
1969 Distributed adaptive Estimated delay as performance criterion Bellman-Ford algorithm (appendix 10a) Node exchanges delay vector with neighbors Update routing table based on incoming info Doesn't consider line speed, just queue length Queue length not a good measurement of delay Responds slowly to congestion
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
263
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ARPANET Routing Strategies(2)ARPANET Routing Strategies(2) Second Generation
1979 Uses delay as performance criterion Delay measured directly Uses Dijkstra’s algorithm (appendix 10a) Good under light and medium loads Under heavy loads, little correlation between reported delays and those experienced
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
264
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ARPANET Routing Strategies(3)ARPANET Routing Strategies(3) Third Generation
1987 Link cost calculations changed Measure average delay over last 10 seconds Normalize based on current value and previous results
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
265
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
266
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
267
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
268
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Mean delay, T= C
1
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
269
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
270
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Distance Vector RoutingDistance Vector Routing
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
271
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Count to Infinity ProblemCount to Infinity Problem
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
272
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
273
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
274
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
275
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Link State RoutingLink State Routing
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
276
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
277
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Hierarchical RoutingHierarchical Routing
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
278
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
279
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
280
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
281
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
when too many packets are present in (a part of the) subnet, performance degrades, and the situation is called congestion
as traffic increases too far, the routers are no longer able to cope, and they begin losing packets
at very high traffic the performance collapses completely, and almost no packets are delivered
congestion can be brought about by insufficient memory to hold the packets, slow processors, low-bandwidth lines
Congestion tends to feed upon itself and become worse
congestion control has to do with making sure the subnet is able to carry the offered traffic, flow control, in contrast relates to point-to-point traffic between a given sender and a receiver
Congestion ControlCongestion Control
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
282
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
CongestionCongestion
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
283
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
control theory approach divides the solutions into two groups: open loop and closed loop
open loop solutions tend to solve the problem by good design, in essence, to make sure that it does not occur in the first place
closed loop solutions are based on the concept of feedback loop
closed loop handles congestion control by: monitoring the system to detect when and where
congestion occurs passing this information to place where action can be
taken adjusting system operations to correct the problems
open loop manages congestion by a technique called traffic shaping - forcing the packets to be transmitted at a more predictable rate
General PrinciplesGeneral Principles
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
284
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
285
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
•Traffic shaping is used to regulate the average rate of data transmission which is implemented using the leaky bucket algorithm and the token bucket algorithm
Leaky Bucket AlgorithmLeaky Bucket Algorithm
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
286
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
287
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Token Bucket AlgorithmToken Bucket Algorithm
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
288
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
289
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Congestion Control in Virtual CircuitCongestion Control in Virtual Circuit
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
290
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Waiting Fair QueueWaiting Fair Queue
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
291
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Chock PacketChock Packet
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
292
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP Addressing
IP Address Requirements What is an IP Address? Network IDs and Host IDs What is a Physical Segment? IP Addressing Rules Classfull IP Addressing Address Classes Class A Addresses Class B Addresses Class C Addresses Class D & E Addresses Address Class Summary
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
293
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Each Device that uses TCP/IP needs at least one!
Computer/Host (each Network Interface Card) Routers (each port or connection) Printers Other Devices
Each Device needs a Unique IP Address An Example:
206.77.105.9
Configured in TCP/IP Software
IP Addressing RequirementsIP Addressing Requirements
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
294
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
What is an IP Address?What is an IP Address?
32-bit Binary Number (Address) 11000000101010000111000100010011 Divided into 4, 8-bit Octets 11000000.10101000.01110001.00010011 Converted to Decimal Numbers
See: Binary Math 192.168.113.19 Decimal range of an Octet: 0-255
It contains the device’s: Network ID and Host ID
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
295
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Network ID and Host IDNetwork ID and Host ID
Network ID Shared or Common to all
computers on the same physical segment
Unique on the Entire Network
“Area Code”
Host ID Identifies a specific device
(Host) within a physical segment
Unique on the physical segment
“Phone Number”
192.176.11.201
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
296
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP Addressing
What is a Physical Segment?
A Broadcast Domain The portion of the network that you can retrieve
information from by using a broadcast packet!
Ignore Repeaters, Bridges, or Switches Forward Broadcasts
Everything (all devices) -- Out a port of a router Between two routers Routers Don’t Forward Broadcasts
IP Addressing Rules All Devices on the Same Physical Segment Share a
Common Network ID Each Physical Segment Has a Unique Network IDs
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
297
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingIP Addressing Rules
Each Device (Host) Needs at Least One Unique IP Address All Devices on the Same Physical Segment Share a Common Network ID (Subnet Mask) Each Physical Segment Has a Unique Network ID (Subnet Mask)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
298
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClassfull IP Addressing
Traditional Manner of Addressing Class A Class B Class C
Address Classes Specify Which Octets of the IP Address are the Network-ID and Which are the Host-ID
Address Classes Specify Network Sizes (Number of Hosts)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
299
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingAddress Classes
Class A Network . Host . Host . Host
Class B Network . Network . Host . Host
Class C Network . Network . Network . Host
Class D & E
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
300
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass A Networks: The Definition
Per Specification: 1st Octet is the Network ID 2nd, 3rd, 4th Octets are the Host ID
In Binary – Any address that starts with a “0” in the first bit! First Class A Network Address:
00000001.00000000.0000000.00000000 (Binary) 1.0.0.0 (Decimal)
Last Class A Network Address: 01111111.00000000.00000000.00000000 (Binary) 127.0.0.0 (Decimal) (Loopback Address)
Class A Networks: The Definition
Per Specification: 1st Octet is the Network ID 2nd, 3rd, 4th Octets are the Host ID
In Binary – Any address that starts with a “0” in the first bit! First Class A Network Address:
00000001.00000000.0000000.00000000 (Binary) 1.0.0.0 (Decimal)
Last Class A Network Address: 01111111.00000000.00000000.00000000 (Binary) 127.0.0.0 (Decimal) (Loopback Address)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
301
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass A Networks: Network IDs
1st Octet is the Network ID 0.0.0.0 (Invalid) 1.0.0.0 2.0.0.0 3.0.0.0 ~~~~ 127.0.0.0 (Loop back)
2nd, 3rd, 4th Octets are the Host IDs An Assigned Class A Network Address:
33.0.0.0 (Specifies the Network) 2nd, 3rd, 4th Octets are the Host IDs
Specified by Network Administrators
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
302
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass A Networks: The Number of Networks
1st Octet is the Network ID 1-126 = 126 Possible Class A Network IDs
2nd, 3rd, 4th Octets are the Host IDs Each of the three Octets has a possible 256 Host IDs Number of Host IDs from three Octets:
256 * 256 * 256 = 16,777,216 (minus 2) = 16,777,214 Always Subtract 2 from the number of Host IDs
Host IDs cannot be all 1’s (reserved for broadcast address)
Host IDs cannot be all 0’s (reserved for “this network only” address)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
303
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass A Networks: Host ID Addresses
33.0.0.0 (An Assigned Class A Address) All devices would share the 33 network ID. The Administrator would number the IP devices:
33.0.0.1 – 33.0.0.255 (255 Addresses) 33.0.1.0 – 33.0.1.255 (256 Addresses) ~~~~ 33.0.255.0 -- 33.0.255.255 (256 Addresses)
(A Total of 65,535 Addresses) 33.1.0.0 -- 33.1.255.255 (65,536 Addresses) 33.2.0.0 -- 33.2.255.255 (65,536 Addresses) ~~~~ 33.255.0.0 -- 33.255.255.254 (65,535 Addresses)
( Total Addresses: 16.7 Million)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
304
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass B Networks: The Definition
Per Specification: 1st and 2nd Octets are the Network ID 3rd, 4th Octets are the Host IDs
In Binary – Any address that starts with a “10” in the first two
bits of the first octet! First Class B Network Address:
10000000.00000000.0000000.00000000 (Binary) 128.0.0.0 (Decimal)
Last Class B Network Address: 10111111.11111111.00000000.00000000 (Binary) 191.255.0.0 (Decimal)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
305
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass B Networks: Network IDs
1st and 2nd Octets are the Network IDs 128.0.0.0 128.1.0.0 ~~~~ 128.255.0.0 129.0.0.0 129.1.0.0 ~~~~ 191.255.0.0
3rd, 4th Octets are the Host IDs An Assigned Class B Network Addresses
153.11.0.0 3rd, 4th Octets are the Host IDs
Specified by Network Administrators
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
306
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass B Networks: The Number of Networks
1st and 2nd Octets are the Network IDs 1st Octet 128 -- 191 = 64 Possible Network IDs 2nd Octet 0 – 255 = 256 Possible Network IDs Total Class B Network IDs 64 * 256 = 16,384
3rd, 4th Octets are the Host IDs Each of the Two Octets has a possible 256 Host IDs Number of Host IDs from Two Octets:
256 * 256 = 65,536 (minus 2) = 65,534 Always Subtract 2 from the number of Host IDs
Host ID cannot be all 1’s (reserved for broadcast address) Host ID cannot be all 0’s (reserved for “this network only”
address)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
307
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass B Networks: Host ID Addresses
An Assigned Class B Address 153.11.0.0
All devices would share the 153.11 Network ID. The Administrator would number the IP devices:
153.11.0.1 -- 153.11.0.255 (255 Addresses) 153.11.1.0 -- 153.11.1.255 (256 Addresses) 153.11.2.0 -- 153.11.2.255 (256 Addresses) ~~~~ 153.11.255.0 -- 153.11.255.254 (255 Addresses) Total Addresses: 65,534
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
308
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass C Networks: The Definition
Per Specification: 1st, 2nd, 3rd Octets are the Network ID 4th Octet is the Host ID
In Binary – Any address that starts with a “110” in the first three
bits of the first octet! First Class C Network Address:
11000000.00000000.0000000.00000000 (Binary) 192.0.0.0 (Decimal)
Last Class C Network Address: 11011111.11111111.11111111.00000000 (Binary) 223.255.255.0 (Decimal)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
309
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass C Networks:
Network IDs
1st, 2nd, 3rd Octets are the Network IDs 192.0.0.0 – 192.0.255. 0 192.1.0.0 – 192.1.255.0 ~~~~ 192.255.0.0 – 192.255.255.0 193.0.0.0 – 193.255.255.0 ~~~~ 223.0.0.0 – 223.255.255.0 4th Octet is the Host IDs
An Assigned Class C Network Address 201.11.206.0 4th Octet is the Host IDs
Specified by Network Administrators
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
310
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass C Networks: The Number of Networks
1st, 2nd, 3rd Octets are the Network IDs 1st Octet 192 -- 223 = 31 Possible IDs 2nd Octet 0 – 255 = 256 Possible IDs 3nd Octet 0 – 255 = 256 Possible IDs Total Class C Network IDs 32 * 256 *256 = 2,097,152
4th Octet is the Host ID An Octet has a possible 256 IDs Number of Host IDs an Octet:
256 (minus 2) = 254 Always Subtract 2 from the number of Host IDs
Host ID cannot be all 1’s (reserved for broadcast address) Host ID cannot be all 0’s (reserved for “this network only”
address)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
311
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass C Networks: Host ID Addresses
An Assigned Class C Address 201.11.206.0
All devices would share the 201.11.206.0 Network ID.
The Administrator would number the IP devices: 201.11.206.1, 201.11.206.2, ~~~~ 201.11.206.254
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
312
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingClass D & E
Class D Used by Multicast Applications Shared Addresses 224.0.0.0 – 239.255.255.255
Class E Experimental 240.0.0.0 +
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
313
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingAddress Classes: Network IDs and Host IDs
Class A (1st Octet 1-127) Network.Host.Host.Host
Class B (1st Octet 128-191) Network.Network.Host.Host
Class C (1st Octet 192-223) Network.Network.Network.Host
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
314
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingAddress Class Summary
1st Networks Hosts IDs Octet IDs /Network
Class A 1-127 12616,777,214
Class B 128-191 16,384 65,534 Class C 192-223 2,097,152 254
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
315
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingIP Address: What is It?
32-bit Binary Number (Address) 11000000101010001110000100010011 Divided into 4, 8-bit Octets 11000000.10101000.11100001.00010011 Converted to Decimal Numbers
See: Binary Math 192.168.225.19 Decimal range of an Octet: 0-255
It contains the device’s: Network ID and Host ID
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
316
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingIP Addressing Rules
Each Device (Host) Needs at Least One Unique IP Address
All Devices on the Same Physical Segment Share a Common Network ID (Subnet Mask)
Each Physical Segment Has a Unique Network ID (Subnet Mask)
Advanced Java Programming
04/08/23 09:1304/08/23 09:13
317
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP AddressingIP AddressingAddress Classes: Network IDs and Host IDs
Class A (1st Octet 1-127) Network.Host.Host.Host
Class B (1st Octet 128-191) Network.Network.Host.Host
Class C (1st Octet 192-223) Network.Network.Network.Host