Title: CS422 Computer Networks
1CS422 Computer Networks
- Gustavo Rodriguez-Rivera
- Purdue University
- (Part 1)
2Introduction
- Instructor
- Gustavo Rodriguez-Rivera
- E-mail grr_at_cs.purdue.edu
- Office LWSN1169
- Webpage
- http//www.cs.purdue.edu/homes/cs422
- The syllabus and everything you need for the
class is there. Add the link to your list of
favorites.
3Mailing List
- Add yourself to the mailing list.
- From your CS account type
- mailer add me to cs422-pso1 or
- mailer add me to cs422-pso2 or
- mailer add me to cs422-pso3
- depending on your PSO
- To verify type
- mailer list cs422-psoN where N is the number of
your PSO. - If you do not have a CS account send e-mail to
grr_at_cs.purdue.edu
4Textbook and Grading
- Textbook
- Comer, Computer Networks and Internets
- Grading
- 50 Projects
- 50 Midterm and Final
- PSOs
- I encourage you to attend PSOs. Projects will be
explained there.
5Syllabus
- 1. Low Level Details
- Signals and Media
- Frequency Spectrum
- Bandwidth, Throughput and Noise
- Digital vs. Analog signals
- Synchronous/Asynchronous Communication
- Modulation and Modems
- Time and Frequency Division Multiplexing
6Syllabus
- 2. Packet Transmission
- Frames
- Error detection Techniques
- LAN/WAN topologies
- Bus Topology, CSMA/CD CSMA/CA
- Ethernet and 802.11 wireless networks
- Repeaters, Bridges, Hubs, and Switches
- Routing Algorithms Distance Vector and Link
State. Shortest Path Algorithm.
7Syllabus
- 3.Internetworking
- Protocol Layering
- IP Addressing
- ARP
- IP fragmentation/reassembly
- ICMP, UDP
- TCP, reliability, flow control, congestion
control, port multiplexing - NAT, Firewalls
8Syllabus
- 4.Applications
- DNS
- Telnet, FTP, HTTP, CGI
- RPC, Java RMI, CORBA
- IPV6
9History of the Internet
- In the late 1960s the Department of Defense
Advance Research Project Agency (ARPA) created a
nationwide network to allow computer access to
the different research centers. - The alternative was to give a computer to each
center/university but this was very- expensive. - Research in the Internet continued in the 70s and
80s - The Internet became a commercial success in the
90s.
10History of the Internet
- The Internet has been doubling in size every nine
to twelve months. - Some people attributes the increase in
productivity in the last 10 years to the
existence of the Internet. People produce more in
less time.
11What is a Network?
- A network is a group of interconnected computers
- A network can provide
- Resource Sharing Files, Data Bases, Printers
- Remote Execution ssh, telnet
- Communication E-mail
- PCs started as autonomous units. Now access to
the Internet is very important.
12Transmission Media
- Forms of energy used for transmission of
information - Electricity
- Radio Waves
- Light (Laser, Infrared)
- Sound
13Transmission Media
- Copper Wire
- Coaxial Cable (Tolerant to electromagnetic noise)
- Twisted Pair (not as tolerant to noise but
cheaper). - Optical Fiber
- Less susceptible to noise than copper wire
- Higher throughput
- Longer distances
- Difficult to handle and expensive
14Transmission Media
- Radio. Also called RF
- It uses electromagnetic waves.
- Different sources of information can be sent
using multiple channels. - Each channel will use a different non-overlapping
section of the frequency spectrum. - For example, the AM band is 540KHZ-1630KHZ. Each
radio station uses 10KHZ of the spectrum. Max
number of radio stations is (1630-540)/10109 - Microwaves and high radio frequencies need a
clear path
15Radio Frequency Spectrum
16Transmission Media
- Infrared
- Cheap
- Used in Small Areas
- Used to communicate computers to small devices.
17Limits of a Transmission System
- Propagation Delay
- Time required for a signal to travel across
media. - Light in vacuum c3x108m/s
- Electricity in cooper .7c
- Bandwidth
- Maximum number of times per second a signal can
change. This limits the maximum throughput.
18Analog and Digital Encoding
- Analog Encoding
- The signal is sent through the transmission
medium as is. - This makes the signal susceptible to noise.
- At the receiving edge, it is difficult to tell
the signal from the noise.
19Analog Encoding
Transmission channel
transmitter
receiver
Noise (Power Lines, Thunderstorms, Thermal Noise,
Blenders etc.)
Input Signal
Output Signal
20Analog and Digital Encoding
- Digital Encoding
- The signal is sampled at a fixed interval.
- Each sample is quantized to a finite number of
levels where the corresponding level is
translated into a number - This number is transmitted in 0s and 1s
- At the destination the 0s and 1s (bits) in the
signal are reconstructed even in the presence of
noise and translated back to a signal level. - Digital encoding is tolerant to noise.
21Digital Encoding
Transmission channel
transmitter
receiver
Input Signal
15
12
8
Noise From Transmission Channel (Power Lines,
Thunderstorms, Thermal Noise, Blenders etc.)
4
0
Output Signal
Signal Samples
8,12,13,13,14,14,14,13,12,11
Transmitted Signal
Received Signal
Reconstructed Signal
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
8
12
8
12
13
13
8
12
13
22Quantization Noise
- One of the problems of digital encoding is that
the number of levels is finite. For example,
there are only 16 levels in the last example. - This means that 12.6 and 13 are rounded to level
13. - This rounding error is called quantization
noise. - The more levels the smaller the quantization
noise. - Usually this quantization noise is negligible.
23Standards
- To ensure the interoperability among hardware of
different vendors, standards are created. - ITU International Telecommunications Union
- EIA Electronic Industries Association
- IEEE Institute of Electrical and Electronic
Engineers
24Example The RS232 Standard
- Called Serial Line
- Produced by EIA
- Used initially to connect dumb terminals
- It is currently used by keyboard and mouse.
- It is a predecessor of USB (Universal Serial Bus)
- RS232 is a very simple standard for the
transmission of characters.
25RS232 Standard
- It is called serial because one bit is sent
after another. - Communication is asynchronous because the
receiver does not know when the next character
will be received. - A start bit and a stop bit are required.
- Uses 15V for 0 and 15V for 1.
- When idle the level is always 15V
26RS232 Standard
- It uses one start bit to always signal start of
transmission. - Sender and receiver must agree on the of bits
per character (7 or 8) and speed in bauds
(bits/sec).
15
0
0
0
0
0
1
1
1
1
-15
Idle
Stop bit (same as 1)
Start Bit (same as 0)
27RS232 Standard
- Typical Speeds
- 9.6 Kbps
- 14.4 Kbps
- 28.8 Kbps
- Disagreement between transmitter and receiver
results in framing error - RS232 can be
- One way (half duplex)
- Two way (full duplex)
28RS232 Standard
- Serial lines usually use only three cables
T
T
R
R
G
G
- Because of its simplicity, RS232 is still in use
in embedded devices.
29Transmission Problems
- Resistance of cable makes the signal decrease as
it travels. - Intrinsic capacitance and inductance of cable
distorts signal - Distortion results in loss of information
Transmitted Signal
Received Signal
1
1
1
1
1
1
0
0
0
0
0
0
8
12
8
12
13
13
30Transmission Problems
- RS232 deals with these problems by
- Tolerating a lower voltage
- Takes multiple samples
- Direct current (two levels) cannot be used for
long distances. - For long distances, an sine signal (called
carrier wave) is used - Some of its properties are changed (modulated) to
encode the data.
31Characteristics of a Carrier Wave
Frequency (Hertz) of cycles per sec
Amplitude (volts)
Phase (Radians)
32Types of Modulation
- Amplitude Modulation (AM)
- Frequency Modulation (FM)
- Phase Modulation (PM)
33Amplitude Modulation (AM)
- Data is encoded by changing the amplitude of the
carrier wave. - This encoding is simple to implement but it is
susceptible to noise. - Noise affects the amplitude of the carrier wave.
Carrier Wave
Modulated Wave
Amplitude Modulator
Input Data
34Frequency Modulation (FM)
- Data is encoded by changing the frequency of the
carrier. - More tolerant to noise than AM since noise
affects little the frequency of the carrier. - However, FM is more difficult to implement than
AM and uses more bandwidth.
Carrier Wave
Modulated Wave
Frequency Modulator
Input Data
1
1
0
0
35Phase Shift Modulation (PM)
- Data is encoded by changing the phase (angle or
displacement) of the signal. - This encoding is also tolerant to noise but also
it is more difficult to implement. - The carrier is displaced to encode the data
(datajump) 00pi/4,01pi/2, 103pi/4,11pi
Carrier Wave
Jump of pi/201
Modulated Wave
Phase Modulator
Input Data
1
1
1
0
Jump of pi 11
36Modems
- A modem is a hardware device used for
long-distance communication - A modem is formed by a modulator that modulates
the data in a carrier signal and a demodulator
that converts the modulated signal back to data. - Each endpoint in the communication has a modem.
- Modulator in one side connects to demodulator in
the other side.
37Modems
Transmitted Data
Transmitted Modulated Data
Modulator
Received Data
Received Modulated Data
Demodulator
Modem
Phone Modem, Cable Modem, DSL Modem etc.
Remote PC, or Internet hub
PC at home
M
D
Modem
Modem
D
M
RS232, Ethernet, etc
RS232, Ethernet etc.
Phone Line, cable, optical fiber etc.
38Modem Types
- Telephone modem
- Optical Modem (Optical fiber)
- Cable modem
- DSL Modem
- etc
39Modem Types
- Full-duplex modem
- 2 way communication
- Allows simultaneous transmission in both ways
- Needs 4 wires
- Half duplex
- Can provide 2 way communication but it transmits
in only one direction at a time. - It uses only two wires.
40Bandwidth and Throughput
- Bandwidth
- the number of times per second a signal can
change in the transmission medium. - Throughput
- The number of bits per second that can be
transmitted in the transmission medium - The higher the bandwidth, the higher the
throughput. - There are two equations that relate bandwidth and
throughput Nyquist theorem and Shannons theorem.
41Nyquist Theorem
- It relates network bandwidth and throughput but
it does not include noise. - It is very optimistic. It just gives a
theoretical limit - D2Blog2K
- Dthroughput,
- BBandwidth,
- KNumber of levels used to encode the data.
- Example for RS232 with two levels (K2) with
B4KHz - D2(4K)log228Kbits/sec
42Shannons theorem
- It gives a more practical limit since it includes
noise in the equation. - CBlog2(1S/N)
- CThroughput in bits/sec,
- Bbandwidth,
- Spower of the signal,
- Npower of the noise.
- S/N is called signal to noise ratio.
43Shannons Theorem
- Example Telephone System
- Bandwidth 3000Hz
- S/N1000
- C3000log2(11000)30,000bps
44Signal to Noise Ratio
- Signal to noise ratio is usually given in
decibels(dB) - S/N in decibels 10log10(S/N)
- Example
- S/N1000
- S/N in decibels 10log10(1000)10(3)30dB
- Example
- S/N20dB
- 20 10log10(S/N) -gt2 log10(S/N) -gtS/N102100
45Nyquist and Shannons Theorems
- Nyquist theorem implies that finding new ways to
encode more bits per cycle improves data rate. - Shannons theorem implies that no amount of
clever encoding can overcome the limits of real
transmission lines.
46Multiplexing
- Multiplexing allows transmitting two sources of
information using a shared channel. - Each destination receives the data that
corresponds to that source.
IN1
OUT1
Shared Channel
IN2
OUT2
Multiplexer
Demultiplexer
OUT3
IN3
47Multiplexing
- Multiplexor
- Accepts data from different sources and sends
combined data through shared channel. - Demultiplexor
- Receives combined data and extracts the data that
corresponds to each destination. - Types of multiplexing
- Time Division Multiplexing
- Frequency Division Multiplexing
48Time Division Multiplexing (TDM)
- The channel is multiplexed by interleaving data
from one source or the other at different times. - The item is marked to identify the source.
- The demultiplexer uses the mark to deliver the
data to the corresponding destination.
A 0100100
A01
Shared Channel
B 1011010
Multiplexer
Demultiplexer
B10
A0, B1, C1, A1, B0, C1
C11
C 1100111
49Time Division Multiplexing (TDM)
- If there is no mark to identify the source, then
the transmitter need to synchronize to be able to
tell which data item belongs to what input
signal. - An example of TDM is the ethernet, where data
from different sources share the ethernet cable. - Each ethernet packet is labeled with the source
and destination hardware address.
50Frequency Division Multiplexing (FDM)
- Data from multiple sources is sent simultaneously
using different sections of the frequency
spectrum. - Two or more signals that use different carrier
frequencies can be transmitted over the same
medium without interference.
AM Frequency Spectrum
Station 1
WBAA
Station 3
Station 4
540KHz
1600KHz
920KHz
10KHz
51Frequency Division Multiplexing (FDM)
- Example AM/FM Radio and Cable TV use multiple
frequency channels - When applied to light FDM is called Wave Division
Multiplexing or WDM.
52Packet Switching
- Instead of connecting computers 1 to 1, computers
are connected to a shared network. - Connecting computers 1 to 1 would require
n(n-1)/2 connections. - It is less expensive to have one shared network
with many computers connected.
C
A
Shared Network
D
B
53Problems with shared networks
- They may have a lot of traffic
- Some applications may transfer large amounts of
information (music, videoconferencing) and may
monopolize the shared network for a long time. - Some applications cannot wait, like interactive
applications or VoIP. - We need fair access for all computers
54Solution for Fairness
- In shared networks we use Packet Switching.
- In Packet Switching the data is divided into
small units called packets. - One station can send only one packet before
another station waiting to send sends another
packet. - This is a form of time division multiplexing.
55Packet Switching
- The packets have a maximum length and a format.
- The structure/format of the packet is called
frame. - Packet Switching Steps
- Acquire Shared Medium
- Send one packet
- Allow other stations to send packets before
sending again
56Frame Format Used by RS232
- RS232 transmissions consist in a sequence of
characters. - SOH and EOT at mark are special characters that
mark the beginning and end of the message - SOH - Start of Header
- EOT End of Text
57Byte Stuffing
- Problem If the data contains special characters
like SOH or EOT, the receiver may confuse them as
start/end of transmission. - Solution For these characters use an alternative
representation called byte stuffing. - Byte stuffing consists in having the sender
substitute the special characters by an escape
sequence before the message is sent. - The receiver translates the stuffed message back
to the original message
58Byte Stuffing
- Escape sequences
- SOH ESC X
- EOT ESC Y
- ESC ESC Z
Original Message
EOT
A
B
C
SOH
EOT
SOH
D
MessageSent
SOH
A
C
D
ESC
X
Y
EOT
ESC
B
59Handling Errors
- Data sent can be corrupted during transmission.
- Bits can be lost
- Bit values can be changed
- The frame includes additional information to
detect and correct errors. - This information is set by the sender and checked
by the receiver. - There is a very small probability of having
undetected errors but it works well in practice.
60Error Detection Techniques
- There are three main error detection techniques
- Parity Bit
- Checksum
- Cyclic Redundancy Check (CRC)
61Parity Bit
- One additional bit per character makes sure that
the number of 1s in the character is even or
odd. - Even parity Total number of 1s (including
parity bit) is an even number - Odd parity Total number of 1s (including the
parity bit) is an odd number - Transmitter and receiver agree on what kind of
parity to use (even or odd). - Receiver verifies that the character received has
the correct number of 1s.
62Parity Bit
- Example 1
- Assume parity is even ( of 1s including parity
bit is even) - The character is 1001001.
- Parity bit is the highest bit
- The character sent by the sender is 11001001 with
the parity bit set to 1 (highest bit) to have
even parity.\ - Receiver verifies that number of 1s in character
is even.
63Parity Bit
- Example 2
- Assume parity is odd ( of of 1s including parity
bit is odd) - The character is 1111001.
- Parity bit is the highest bit
- The character sent by the sender is 01111001 with
the parity bit (highest bit) set to 1 to have odd
parity. - Receiver verifies that number of 1s in character
is odd.
64Parity Bit
- The sender and the receiver agree before the data
transmission of the type of parity (even or odd) - The sender sets the parity bit.
- The receiver checks that the parity of the bit is
correct and signals an error if it is not correct.
65Checksum
- In checksum the data is treated as a sequence of
integers. - The sender computes the arithmetic sum of the
data and adds it into the message. - The receiver receives the message and computes
the checksum again. - If the checksum computed by the receiver is
different than the checksum in the message, the
receiver signals an error and discard the
message.
66Checksum Example
00010010
01010010
10011010
01010011
01010001
Checksum
Data
00010010-gt 18
01010010-gt 82
10011010-gt 154
01010011-gt 83
101010001-gt 337
Checksum
Only take the lower 8 bits for the checksum In
other cases the checksum is computed using words
of 4 bytes
67Undetected Errors
- It is possible to have undetected errors using
checksum. - For instance, an error that happens twice in the
same bit position in two of the data bytes can
cause an error that will be undetected. - These errors that happen in the same bit is
called a positional error and may happen in bad
hardware. - Checksum works well in practice.
68Undetected error
Error
Error
0
1
00010010
01010010
10011010
01010011
01010001
Checksum
00010010-gt 18
Data
00010010-gt 18
11011010-gt 218
01010011-gt 83
101010001-gt 337
Checksum
- The data changed but the checksum is the same.
- The receiver will not be able to detect the
error
69Cyclic Redundancy Check (CRC)
- It is implemented in hardware.
- Implementing it in software is too slow
- Basic Operations
- XOR
- Shift Operator
0
0
1
1
0
1
0
1
1
0 In
1 out
Before
70Cyclic Redundancy Check (CRC)
- Hardware to compute the 16 bit CRC
- The CRC registers are initialized with 0s
- The data bits are fed one by one in the input.
- The final CRC will be stored in the CRC
registers.
1
1
1
0
1
0
1
0
0
0
0
1
1
0
1
0
1
0
0
1
1
0
0
0
Input 1
71Cyclic Redundancy Check (CRC)
- Example of an input of 101
- .
1
1
1
0
1
0
1
0
0
0
1
1
1
0
1
0
1
0
1
0
1
1
0
0
Input 1
0
0
0
1
0
1
1
0
1
1
1
0
0
1
0
0
0
0
0
0
1
0
1
0
Input 0
1
1
1
0
1
0
1
1
0
1
0
0
0
0
1
1
1
0
0
0
1
1
0
0
CRC
Input 1
72Cyclic Redundancy Check (CRC)
- CRC detects the positional errors that checksum
does not detect. - The CRC is used in Ethernet and is computed in
hardware. - Also disks use CRC to detect errors in disk.
73Network Classification
- Local Area Network (LAN)
- Room/Building
- Metropolitan Area Network (MAN)
- City
- Wide Area Network (WAN)
- Group of cities
74Local Area Networks
- Many technologies exist
- High Throughput
- Relatively low cost
- Limited to short distances
- Often rely on shared media
- Wide Area networks tend to be slower than local
area networks.
75Scientific Justification for LANs
- Why Local Area Networks work well in practice?
- A computer is more likely to communicate with
computers that are nearby than with computers
that are distant. - This is known as the locality principle.
76Scientific Justification for LANs
- In the cases that computer communicate mostly
with distant computers, the communication will be
slow. - In some cases, the interaction with distant
computers can be reduced by adding mirror
servers or web caches. - Web caches cache frequently used pages.
77Lab2 HTTP Server Part Iterative Server
- Iterative Server
- while (1)
- ss accept()
- if (sslt0)
- continue
-
- dispatchRequest(ss) //closes ss
78Create process for each request
- -f  Create a new process for each request
- while(1)
- ss accept()
- if (sslt0) continue
- ret fork()
- if (ret0)
- //child
- dispatchRequest(ss) // close ss
-
- //parent
- close(ss)
-
-
79Create thread for each request
- -t Create a new thread for each request
- while(1)
- ss accept()
- if (sslt0) continue
- ret pthread_create(dispatchRequest, ss)
-
80Pool of threads
- Create a pool of threads to serve the requests.
- Main()
- .
- //if pool of threads
- for (i- iltnumofthreads-1 i)
- pthread_create(server_thread,
ms) -
- server_thread(ms)
-
- void server_thread( int ms)
- while(1)
- ss accept( ms, )
- if (sslt0) continue
- dispatchRequest(ss)
-
-
81Network Topology
- Specifies the general shape of a network.
- Primarily refers to interconnections between
computers. - Hides the actual devices.
- Types of Network Topologies
- Star
- Ring
- Bus
82Star Topology
- Central component of the network is known as hub.
- Each computer has a separate connection to the
hub.
83Ring Topology
- No central facility.
- Connections go from one computer to another.
84Bus Topology
- Shared Medium connects the computers.
Shared Cable
85Ethernet Network
- This is an example of a bus network
- Most popular LAN
- IEEE standard is 802.3
- There are several generations of the ethernet
technology - Thicknet (10Base5)
- Thinnet (10Base2)
- Twisted Pair (10Base-T)
86Thicknet Ethernet (10Base5)
- Thicknet Ethernet was the first generation of
ethernet - It used a heavy coaxial cable. Difficult to
handle - The formal name is 10Base5
- The computers attached to the cable through a
tranceiver that transmitted/received the data to
the cable. - It could reach 500m
Tranceivers
87ThinNet Ethernet (10Base2)
- Thicknet Ethernet was the second generation of
ethernet - It used a thiner coaxial cable. Easier to handle
- The formal name is 10Base2
- The computers attached to the cable through a T-
connector - It could reach 185m
T-connectors
88Twisted Pair (1OBase-T)
- It is the modern Ethernet wiring
- It uses a hub or a switch. It could reach 100m.
- A hub simulates the coaxial cable with
electronics. - A switch provides 1 to 1 conection (it will be
covered later) - The modern ethernet is a physical star and a
logical bus or a star-shaped bus
Hub or Switch
89Ethernet Speeds
- Also it has different rates
- 10Mbps
- 100Mbps (Fast Ethernet uses 100Base-T)
- 1Gbps (Gigabit Ethernet uses 1000Base-T)
- It has always been the same packet format
independent of the speed.
90Ethernet Transmission
- Only one station transmits at a time
- Signal propagates across the entire cable.
- All stations including itself receive the
transmission
91Ethernet Transmission
- The ethernet interface will filter the packets
and it will pass to the OS only the packets
destined to the machine - A technique called CSMA/CD controls the access to
the shared bus.
92CSMA/CD
- Carrier Sense Multiple Access/Collision Detection
- Carrier Sense (CS)
- Computers will wait until the medium is idle to
begin transmitting the frame. - Multiple Access (MA)
- Multiple computers share the same media
- All of them use the same access algorithm
- Collision Detection (CD)
- Simultaneous transmissions are possible and will
interfere with each other. This is called a
collision.
93Collision Detection Mechanism
- A computer transmitting a message will listen to
the medium during transmission - If what it listens is different than what it
transmits, the computer has detected a collision. - If a collision has been detected, the computer
will back off and it will try later.
94Back Off After Collision
- After a collision has been detected, the computer
will wait for a random time t1 before
transmitting again where 0 lt t1 lt d where d is
a constant. - If a second collision occurs, the computer will
wait for a random time t2 where 0 lt t2 lt 2d - The range will be doubled after every successive
collision. - This is called exponential back off.
95Ethernet Addressing
- All the stations in the shared medium receive all
transmissions. - Each station has an assigned 48 bit ethernet
address. - The address of an ethernet Network Interface
Card (NIC) is assigned by the manufacturer. - IEEE gives ranges of ethernet addresses to the
different manufacturers.
96Ethernet Addressing
- Each frame contains a destination address
- All stations receive the transmissions.
- The stations discard any frames addressed to
another station.
MSG B-gtD
D
C
B
A
97Ethernet Addressing
- The check of the destination address is done by
the ethernet card itself and not by the OS. - When an ethernet packet is received by a
computer, the OS receives an interrupt so the
packet is processed. - If the checking of the destination address were
done by the OS instead of by the hardware, the
CPU would have unnecessary overhead due to
packets not directed to the machine.
98Ethernet Addressing
- Packets can be sent to
- A single destination (Unicast)
- All the computers on the ethernet (Broadcast)
- A subset of the computers in the ethernet
(Multicast) - Ethernet Unicast
- Sent from one computer to another computer
- Most ethernet packets are unicast.
99Ethernet Broadcast
- All 1s in the destination address specifies a
broadcast FFFFFFFFFFFF - The sender places a packet with the broadcast
address as destination - All computers in the Ethernet will receive a
copy, including the computer that transmitted the
packet.
100Ethernet Multicast
- A Ethernet interface card can be configured by
software which multicast address to accept. - If a packet has as destination this multicast
address, all the computers that have joined the
multicast address receive a copy. - The check for the destination multicast address
is done by the Ethernet interface card. - Half of the Ethernet addresses are reserved for
multicast - Multicast is useful for teleconferencing in the
same net to eliminate duplicate packets.
101Ethernet Card Filtering
- An Ethernet card will pass to the OS the packets
that have as destination - The computers unicast address
- The broadcast address
- Any of the multicast addresses that the computer
has joined. - It is recommended not to use broadcast too
frequently since the CPUs in all the computers
in the network will be interrupted even if they
are not going to use the packet.
102Ethernet Promiscuous Mode
- This is a special Ethernet interface modes
- It is mode allows the interface to pass all the
packets to the OS even when the destination is
not that computer. - It is available in most Ethernet interfaces
- This mode is useful for network monitor programs
like snoop or tcpdump. - A program needs to run as root to be able to
configure an interface into promiscuous mode.
103Ethernet Packet Format
- This the Ethernet packet format
- The frame type fields tells the recipient the
type of data being carried - Possible Ethernet Types
- 0x800 -gtIP
- 0x806 -gtARP
- 0x8137-gtIPX (Novell) etc.
Destination Address
Source Address
Frame Type
Preamble
Data in Frame
CRC
8 bytes
6 bytes
6 bytes
2 bytes
Variable 46 to 1500 bytes
4 bytes
104Ethernet Packet Format
- The maximum number of data bytes that can be sent
in an Ethernet packet is 1500 bytes. - This is called Maximum Transfer Unit or MTU.
- Different networks have different MTU sizes.
105Wireless Networks
- Two kinds of wireless networks
- Infrastructure Mode Networks Hosts in the
network use a base station to communicate. - Ad-Hoc Networks Hosts can communicate with each
other without the need of a base station.
106Wireless Networks Characteristics
- Decreasing signal strength.
- Signal will attenuate as it travels in the space
or through matter. - Interference with other sources.
- Radio sources transmitting at the same frequency
will interfere with each other. Example 2.4GHz
wireless phones and 802.11b - Multipath propagation.
- Radio signals may bounce causing reflections of
the same signal being received simultaneously.
107Wireless Networks Characteristics
- All this characteristics make wireless networks
to have more bit errors than wired networks. - This is why wireless networks employ more
powerful CRCs to detect errors as well as
link-level ARQ (Automatic Repeat Request)
protocols that retransmit corrupt packets.
Data packet
Acknowledgement
A
B
108Wireless Networks and 802.11b
- 802.11 (WiFi or Wireless Fidelity) denotes a
family of wireless network protocols - 802.11b - 2.4 GHz band - 11 Mbps
- 802.11g - 2.4 GHz band - 54 Mbps
- 802.11a - 5 GHz band - 54 Mbps
- 802.11b and 802.11g are the most common and both
are compatible.
109802.11 Architecture
- 802.11 may work in both ad hoc mode and
infrastructure mode. Being infrastructure
mode more common.
Internet
Had Hoc Network
Infrastructure Mode Network
110802.11 Architecture
- When the Administrator installs the access point,
it needs to assign an SSID (Service Set
Identifier) and a channel number. - There are 11 partially overlapping channels in
the band of 2.4GHz-2.485GHz - A base station periodically sends beacon frames.
- A computer scans the 11 channels to be able to
list the available networks.
111802.11 Architecture
- Once the user chooses one of the networks, it
sends a DHCP discovery message to request its IP
address and other parameters. - The Access Point may require the the wireless
station to authenticate itself. - The authentication may require a user name and
password.
112Hidden Terminal Problem
- Given three computers A, B, C in a wireless
network, it is possible that B can receive the
messages from both A and C but A and C cannot
receive messages from each other. - This is due to the restricted range of
transmission (d). - This is problematic because stations will not be
able to tell in some cases when collisions
happen, for example if A sends a message to B at
the same time C sends a message to B, so CSMA/CD
is impractical.
d
d
A
B
C
113CSMA/CA (Collision Avoidance)
- Instead of using CSMA/CD, 802.11 uses CSMA/CA
- CSMA/CA- Carrier Sense Multiple Access Collision
Avoidance - The stations reserve the channel by first sending
a small message RTS/CTS Request to Send / Clear
To Send
114CSMA/CA (Collision Avoidance)
- Assume computer X will send a message to computer
Y. - X sends an RTS (Request to Send) message to Y.
All machines reachable from X receive it. - Y replies with a CTS message (Clear to Send). All
machines reachable from Y receive it. - For the requested time no machine reachable from
X and Y will use the shared medium.
115Collision Avoidance
RTS
d
CTS
X
2
3
1
d
Y
7
5
4
6
116Collision Avoidance
- Even with Collision Avoidance, collisions may
still be possible if computers move or the radio
propagation conditions change. - Still, Collision Avoidance reduces the
probability of collisions.
117802.11 Multiple Access Protocol
- Since wireless networks are more prone to errors,
they use also acknowledgments at the link level - After a packet is sent, an acknowledgment the
transmitter expects an acknowledgment from the
receiver. - If the acknowledgment is not received after some
time, the frame is retransmitted again. - The retransmissions are independent from the
TCP/IP retransmissions and they are called
link-layer acknowledgment
Data packet
Acknowledgement
A
B
118802.11 Multiple Access Protocol
- A packet transmission in 802.11 will look like
this
Source
Destination
RTS
CTS
DATA
ACK
119802.11 Frame Format
- The 802.11 Frame was derived from the Ethernet
frame - The MTU of 802.11 is 2,312 bytes
2
2
6
6
6
2
6
0-2312
2
Frame Control
Address 2
Address 1
Address 3
SequenceControl
Address 4
Duration
Payload
CRC
Protocol Version
More Frag
Power Mgmt.
More Data
Type
Subtype
To AP
From AP
WEP
RSRVD
2
2
4
1
1
1
1
1
1
1
120802.11 Forwarding
- Address1 is the immediate destination address
- Address2 is the source address
- Address3 is used as the final destination in case
the packet is destined to a computer/router in
one of the ethernet ports in the base station.
Address1 B
Address2 A
A
Address3 R
B
R
Ethernet
Router
Access Point
C
121WEPWired Equivalent Privacy
- It is a security feature in 802.11 that uses
encryption at the link level. - An ASCII or hexadecimal key (up to 128 bits) is
configured in the base station and in all the
computers in the same SSID. - The packets are encrypted with this key when
transmitted and decrypted when received. - The method used for encryption stream cypher
RC4 has some weaknesses and potentially packets
can be sniffed.
122WEPWired Equivalent Privacy
- In general it is better to use point-to-point
security like VPN or SSH. - WPA or WPA2 can be used instead of WEP to offer
more security. - Also some users do not use WEP altogether since
WEP is disabled by default in base stations to
simplify the installation.
123Ring Topology
- It is the second most popular LAN topology
- Bits flow in a single direction
- A special short message called token is passed
from computer to computer. - Only the machine that has the token is able to
transmit. - This guarantees fair access
token
124Token Passing
- A computer x that is going to transmit waits for
the token. - The computer x removes the token and sends the
message to y. - The computers transmit the token around the ring.
token
x
y
125Token Passing
- The destination computer receives the message and
makes a copy. - The sender receives its own transmission and it
restores the token to the network. - When there is no data to send, the token
circulates continuously.
x
y
126Advantages of Token Ring
- Easy detection of
- Broken Ring
- Hardware Failures
- Interference
- Weaknesses
- Broken ring disables the entire ring
- Difficult to add stations
- Examples of Token Ring
- Pronet-10 (10 Mbps)
- IBM Token Ring (4Mbps/16Mbps)
- Fiber Distributed Data Interconnect (FDDI) 100Mbps
127FDDI
- Fiber Distributed Data Interconnect
- It uses optical fiber
- High Reliability
- Immune to interference
- There is also CDDI that is FDDI over copper with
the same data rate and frame format but less
noise immunity.
128FDDI
- The stations can also be attached to a hub that
provides a logical ring - It uses also the same frame format and rdata rate
than a physical FDDI. - FDDI with a hub is called star-shaped ring
x
y
FDDI Hub
129FDDI Failure Recovery
- Dual Attached - FDDI uses two rings instead of
one - Self Healing FDDI has an automatic failure
recovery - Counter Rotation The token in the second ring
rotates in the opposite direction.
Loopback
Failed Station
Loopback
After Failure. Stations adjacent to failure loop
back.
Before Failure. Outer Ring is used for data.
Inner Ring is only used in failure mode.
130ATM Example of Star Topology
- ATM Asynchronous Transfer Mode
- Designed by Telephone companies
- Intended to accommodate
- Voice
- Video
- Data
- The building block is known as ATM Switch
- Each station is connected to a switch
- Switches can be interconnected with each other.
ATM Switch
131ATM
- ATM uses full-duplex connections
- Two fibers are required.
- It has high data rates (E.g. 155 Mbps)
- Fixed size packets called cells of 53 bytes
- 48 bytes for data
- 5 bytes for header
- The small size of the packet decreases the
network latency. The smaller the packet, the
smaller the waiting time to send a packet because
the shared network is in use.
132ATM
- Before transmitting, it is necessary to create a
virtual circuit across all the switches,
similar to a telephone long distance call. - The switches negotiate the maximum throughput
that will be used. This bandwidth will be
reserved while the circuit is open.
A
B
133ATM
- ATM is a connection oriented network in the
sense that a connection setup is necessary to be
done in hardware before a transmission. The
bandwidth will be respected by all the switches
in the circuit while the connection is open. - In contrast, the Internet is connection less in
the sense that no connection is necessary for the
communication of two machines. However, bandwidth
will be used first come first served. - ATM is designed for real-time traffic where
Quality of Service (QoS) can be assured like
voice and video. The internet is not designed for
real-time data but it works well for non
real-time data like e-mail, file transfer,
browsing etc.
134ATM
- This connection setup overhead in ATM was one of
the big disadvantages that motivated users not to
use ATM in LANs. - Also, ATM was too expensive. Switches and
interfaces cost thousands of dollars - ATM is still in use for high speed network
backbones where a virtual connection can be used
permanently - There are other cheaper alternatives to ATM like
the Gigabit ethernet.
135Extending Networks
- Each LAN has a distance limitation. For example
the Ethernet has a distance limit of 185 m. - However sometimes it is necessary to extend a
LAN. - Options to extend a LAN
- A repeater Analog device that connects two LAN
segments into a single LAN. It forwards all
packets including noise. Works at the Link Level. - A bridge Digital device that connects two LAN
segments into a single LAN. It forward packets
only when necessary. Works at the Link Level. - A router It connects two LANs keeping them
separate. Works at the Internet Level.(We will
cover it when we see TCP/IP protocols)
136Repeaters
- It is a hardware device used to extend connect
two ethernet segments. - It connects two LAN segments
- It copies blindly packets from one segment from
the other.
Ethernet 1
Ethernet 2
Repeater
137Repeater
- The repeater amplifies signals from one segment
before sending them to the other segment. - The repeater operates in both directions
simultaneously. - It propagates noise and collisions.
- Repeaters also may be used to join more than one
ethernet.
Ethernet 1
R
Ethernet 2
Main Ethernet
R
Ethernet 3
R
138Bridge
- A bridge is also used to connect two Ethernet
segments to form one single Ethernet segment. - It is a digital device.
- It is smarter than a repeater. It forwards
packets but it does not forward noise or
collisions. - It only forwards packets when they are destined
to the other segment.
139Bridge Algorithm
- Listen in promiscuous mode
- Watch source address in incoming packet.
- Listen to the source address of the packets and
make a list of computers attached to each
segment. - Only forward packets when necessary.
- Always forward broadcast and multicast.
140Bridge Algorithm
-
- A message from u to w is not forwarded
- A message from v to y is forwarded.
- The bridge learns from the source addresses of
the packets. - When the destination is not in the list, the
bridge forwards the packet.
Ethernet 1
Ethernet 2
u
v
w
x
y
z
bridge
List1 u,v,w
List2 x,y,z
141Ethernet Hubs and Switches
- Hubs and switches allow building a LAN with
ethernet using a single box. - Ethernet Hub
- It is an analog device that operates on signals
- It simulates a common shared cable.
- It propagates incoming signals to all
connections. It does not understand packets.
142Ethernet Hub
- Ethernet Hub (cont.)
- It can be modeled as a box where each port is
connected with each other through a repeater - The repeaters forward the signals to all the
ports. - It is inexpensive.
- Hubs may be connected in a daisy chain to form a
large Ethernet. - The cost of a hub is O(n) with the number of
ports.
Port1
Port2
Port3
Port4
Port5
R
R
R
R
143Ethernet Switch
- Ethernet Switch
- It also allows building an ethernet using a
single box. - It is a digital device that understands packets
and addresses. - It only forwards when necessary.
- It also allows two separate pairs of computers to
communicate simultaneously. - It is higher in cost than a hub.
144Ethernet Switches
- It can be modeled as a box where there is a
bridge connecting each pair of ports. - In general a bridge with n ports will need
n(n-1)/2 bridges to be able to connect all ports
one-to-one. - This is why the cost of an Ethernet switch grows
O(n2) with the number of ports.
Port1
Port2
Port3
Port4
B
B
B
B
B
B
145Ethernet Switches
- Since a switch allows simultaneous traffic across
two separate pairs of ports, the total throughput
in a switch will be higher than in a hub. - For example, if a 100Mbps switch has 4 ports
a,b,c,d and there is traffic between a to b
and c to d, then the total traffic will be
2 100Mbps 200Mbps.
100Mbps
100Mbps
Total Throughput A-gtB 100Mbps C-gtD
100Mbps Total 200Mbps
A
B
C
D
B
B
B
B
B
B
146Ethernet Hub
- In contrast, a 100Mbps Ethernet hub with ports
a,b,c,d where there is traffic between a to b and
c to d the total throughput will not exceed
100Mbps - Additionally, switches enhance security since
packet sniffing is limited. A port will receive
only packets destined to the port and broadcasts.
Total Throughput A-gtB 50Mbps C-gtD 50Mbps Total
100Mbps
50Mbps
50Mbps
D
A
B
C
R
R
R
147Wide Area Networks
- They span a large geographic distance
- Generally these connections are leased from a
telephone company. - They provide a point-to-point connection.
- They are not part of the conventional telephone
system. - Copper, fiber, microwave, or satellite channels
are available.
148Long-Distance Connections