SlideShare a Scribd company logo
Chapter 3:
Networking and Internetworking
 Concepts
 Switching
 Routing (IP)
 End-to-End Protocols (UDP/TCP)
 Wireless LAN
Introduction
Building Blocks
Nodes: PC, special-purpose hardware…
hosts
switches
Links: coax cable, optical fiber…
point-to-point
multiple access
■ ■ ■
(a)
(b)
Switched Networks
two or more nodes
connected by a link,
or
two or more
networks connected
by a node
A network can be defined recursively as...
Simplified view of the QMW Computer Science network (in mid-2000)
file
compute
dialup
hammer
henry
hotpoint
138.37.88.230
138.37.88.162
bruno
138.37.88.249
router/
sickle
138.37.95.241
138.37.95.240/29
138.37.95.249
copper
138.37.88.248
firewall
web
138.37.95.248/29
server
desktop computers138.37.88.xx
subnet
subnet
Eswitch
138.37.88
server
server
server
138.37.88.251
custard
138.37.94.246
desktop computers
Eswitch
138.37.94
hub
hub
Student subnet
Staff subnet
other
servers
router/
firewall
138.37.94.251
%
1000 Mbps Ethernet
Eswitch: Ethernet switch
100 Mbps Ethernet
file server/
gateway
printers
Campus
router
Campus
router
138.37.94.xx
Firewall configurations
Internet
Router/
Protected intranet
a) Filtering router
Internet
b) Filtering router and bastion
filter
Internet
R/filter
c) Screened subnet for bastion R/filter Bastion
R/filter Bastion
w eb/ftp
server
w eb/ftp
server
w eb/ftp
server
Addressing and Routing
Address: byte-string that identifies a node
usually unique
Routing: process of forwarding messages to the
destination node based on its address
Types of addresses
unicast: node-specific
broadcast: all nodes on the network
multicast: some subset of nodes on the network
Inter-Process Communication
 Turn host-to-host connectivity into process-to-process
communication.
 Fill gap between what applications expect and what
the underlying technology provides.
Host
Host
Host
Channel
Application
Host
Application
Host
Multiplexing
Circuit switching: carry bit streams
original telephone network
Packet switching: store-and-forward messages
Internet
L2
L3
R2
R3
L1 R1
Sw itch 1 Sw itch 2
Statistical Multiplexing
 On-demand time-division
 Schedule link on a per-packet basis
 Packets from different sources interleaved on
link
 Buffer packets that are contending for the link
 Buffer (queue) overflow is called congestion
■ ■ ■
What Goes Wrong in the Network?
Bit-level errors (electrical interference)
Packet-level errors (congestion)
Link and node failures
Packets are delayed
Packets are deliver out-of-order
Third parties eavesdrop
Conceptual layering of protocol software
Layer n
Layer 2
Layer 1
Message sent Message received
Communication
medium
Sender Recipient
Protocol layers in the ISO Open Systems Interconnection (OSI) model
Application
Presentation
Session
Transport
Netw ork
Data link
Physical
Message sent Message received
Sender Recipient
Layers
Communication
medium
most peer-to-peer communication is indirect
peer-to-peer is direct only at hardware level
Encapsulation as it is applied in layered protocols
Presentation header
Application-layer message
Session header
Transport header
Netw ork header
ISO Architecture
One or more nodes
w ithin the netw ork
End host
Application
Presentation
Session
Transport
Netw ork
Data link
Physical
Netw ork
Data link
Physical
Netw ork
Data link
Physical
End host
Application
Presentation
Session
Transport
Netw ork
Data link
Physical
OSI protocol summary
Layer Description Examples
Application Protocols that are designed to meet the communication requirements of
specific applications, often defining the interface to a service.
HTTP,FTP, SMTP,
CORBA IIOP
Presentation Protocols at this level transmit data in a network representation that is
independent of the representations used in individual computers, which may
differ. Encryption is also performed in this layer, if required.
Secure Sockets
(SSL),CORBA Data
Rep.
Session At this level reliability and adaptation are performed, such as detection of
failures and automatic recovery.
Transport This is the lowest level at which messages (rather than packets) are handled.
Messages are addressed to communication ports attached to processes,
Protocols in this layer may be connection-oriented or connectionless.
TCP, UDP
Network Transfers data packets between computers in a specific network. In a WAN
or an internetwork this involves the generation of a route passing through
routers. In a single LAN no routing is required.
IP, ATM virtual
circuits
Data link Responsible for transmission of packets between nodes that are directly
connected by a physical link. In a WAN transmission is between pairs of
routers or between routers and hosts. In a LAN it is between any pair of hosts.
Ethernet MAC,
ATM cell transfer,
PPP
Physical The circuits and hardware that drive the network. It transmits sequences of
binary data by analogue signalling, using amplitude or frequency modulation
of electrical signals (on cable circuits), light signals (on fibre optic circuits)
or other electromagnetic signals (on radio and microwave circuits).
Ethernet base- band
signalling, ISDN
TCP/IP layers
Messages (UDP) or Streams (TCP)
Application
Transport
Internet
UDP or TCP packets
IP datagrams
Network-specific frames
Message
Layers
Underlying network
Network interface
Encapsulation in a message transmitted via TCP over an Ethernet
Application message
TCP header
IP header
Ethernet header
Ethernet frame
port
TCP
IP
The programmer's conceptual view of a TCP/IP Internet
IP
Application Application
TCP UDP
Internet Architecture
Hourglass Design
Application vs Application Protocol (FTP, HTTP)
■ ■ ■
FTP
TCP UDP
IP
NET 1 NET2 NET n
HTTP SMTP TFTP
Protocol Multiplexing
Multiplexing and Demultiplexing (demux key)
Encapsulation (header/body)
Host Host
Application
program
Application
program
RRP
Data Data
HHP
RRP
HHP
Application
program
Application
program
RRP Data RRP Data
HHP RRP Data
Switching
Scalable Networks
 Switch
Connect links to form a larger network.
Connect switches to form a larger network.
forwards packets from input port to output port
port selected based on address in packet header
 Advantages
store and forward
support large numbers of hosts
Datagram Switching
 No connection setup phase
Sometimes called connectionless model
 Each packet forwarded independently
 Each switch maintains a forwarding (routing) table
Eg. Switch 1
0
1
3
2
0
1 3
2
0
1
3
2
Sw itch 3 Host B
Sw itch 2
Host A
Sw itch 1
Host C
Host D
Host E
Host F
Host G
Host H
Address Port
A 2
C 3
F 1
G 1
… …
Datagram Model
 Source host has no way of knowing if the network is
capable of delivering a packet or if the destination host
is even up.
No QoS
 Since packets are treated independently, it is possible
to route around link and node failures.
 Since every packet must carry the full address of the
destination, the overhead per packet is higher than for
the connection-oriented model.
Do not forward to all the other ports (broadcast)
when unnecessary
Maintain forwarding table
Host Port
A 1
B 1
C 1
X 2
Y 2
Z 2
Learn table entries based on source address
Table is an optimization; need not be complete
Always forward broadcast frames
Learning Bridges
A
Bridge
B C
X Y Z
Port 1
Port 2
Routing (IP)
Internetworking
Concatenation of Different Networks
R2
R1
H4
H5
H3
H2
H1
Netw ork 2 (Ethernet)
Netw ork 1 (Ethernet)
H6
Netw ork 4
(point-to-point)
H7 R3 H8
Netw ork 3 (FDDI)
IP Internet
 Connecting Problem 1: Heterogeneity of Networks
Solution: Layered Protocol Stack (IP over …… )
 Problem 2: Scalability in Routing and Addressing
Solution: Address Hierarchy
R1 R2 R3
H1 H8
ETH FDDI
IP
ETH
TCP
FDDI PPP PPP ETH
IP
ETH
TCP
IP IP IP
Service Model
 Connectionless (datagram-based)
 Best-effort delivery (unreliable service)
packets can be lost, delayed, duplicated, delivered out of
order.
 Datagram format: IP header
Version HLen TOS Length
Ident Flags Offset
TTL Protocol Checksum
SourceAddr
DestinationAddr
Options (variable) Pad
(variable)
0 4 8 16 19 31
Data
IP Header
 Version (always set to the value 4 for IP v4)
 IP Header Length (number of 32 -bit words forming the header,
usually five)
 Size of Datagram (in bytes, header + data)
 Flags 3 bits: R (reserved bit set to 0) DF (Don't fragment ) MF (More
fragments)
 Time To Live (Number of hops /links which the packet may be
routed over, decremented by most routers - used to prevent
accidental routing loops)
 Protocol (the type of transport packet being carried (e.g. 1 =
ICMP; 6 = TCP; 17= UDP).
 Header Checksum (A 1's complement checksum of IP header,
updated whenever the packet header is modified by a node.
Packets with an invalid checksum are discarded by all nodes in
an IP network)
 Source Address / Destination Address
Internet address structure, showing field sizes in bits
7 24
Class A: 0 Netw ork ID Host ID
14 16
Class B: 1 0 Netw ork ID Host ID
21 8
Class C: 1 1 0 Netw ork ID Host ID
28
Class D(multicast): 1 1 1 0 Multicast address
27
Class E(reserved): 1 1 1 1 unused
0
globally unique
hierarchical: network + host
Decimal representation of Internet addresses
octet 1 octet 2 octet 3
Class A: 1 to 127
0 to 255 0 to 255 1 to 254
Class B: 128 to 191
Class C: 192 to 223
224 to 239
Class D (multicast):
Network ID
Network ID
Network ID
Host ID
Host ID
Host ID
Multicast address
0 to 255 0 to 255 1 to 254
0 to 255 0 to 255 0 to 255
0 to 255 0 to 255 0 to 255
Multicast address
0 to 255 0 to 255 1 to 254
240 to 255
Class E (reserved):
1.0.0.0 to
127.255.255.255
128.0.0.0 to
191.255.255.255
192.0.0.0 to
223.255.255.255
224.0.0.0 to
239.255.255.255
240.0.0.0 to
255.255.255.255
Range of addresses
Every datagram contains destination’s
address
if connected to destination network, then
forward to the host in LAN
If network number of destination IP == my
network number
if not directly connected, then forward to the
host’s default router
Each router maintains a forwarding table
forwarding table maps network number (rather
than host address) into next hop or interface
number (if directly connected)
Datagram Forwarding Strategy
Traffic: H1 → H3, H1 → H8
R1: default router is R2
R2 Routing Table:
Network Number Next Hop Interface
1 R3 interface 1
2 R1 interface 0
3 - interface 1
4 - interface 0
R2
R1
H4
H5
H3
H2
H1
Netw ork 2 (Ethernet)
Netw ork 1 (Ethernet)
H6
Netw ork 4
(point-to-point)
H7 R3 H8
Netw ork 3 (FDDI)
Address Translation in LAN
 Map IP addresses into physical addresses of the
destination host (if connected directly) or the next hop
router
 ARP
Each host caches its table of IP to physical address bindings
table entries are discarded if not refreshed
timeout in about 10 minutes
broadcast request if IP address not in table
target machine send its physical address to the sender
target machine also updates add entry of the source in its table
It is likely that the target will send IP packets to the source later on.
Other hosts (who receives the broadcasted request) update
table if already have an entry
End-to-End Protocols
 Underlying best-effort network
drop messages
re-orders messages
delivers duplicate copies of a given message
limits packet (not message) to some finite size
delivers messages after an arbitrarily long delay
 Common end-to-end services
guarantee message delivery
deliver messages in the same order they are sent
deliver at most one copy of each message
support arbitrarily large messages
support synchronization between sender and receiver
allow the receiver to flow control the sender
support multiple application processes on each host
End-to-End Protocols
(UDP/TCP)
Simple Demultiplexor (UDP)
 Unreliable and unordered datagram service
 Adds multiplexing
 No flow control or error control
no need for sender-side buffer)
 Endpoints identified by ports
servers listens at well-known ports!
see /etc/services on Unix
 Header format
 Optional checksum
psuedo header (IP.src, IP.dsest, IP.proto, UDP.len) + UDP
header + data
SrcPort DstPort
Checksum
Length
Data
0 16 31
TCP Overview
 Connection-
oriented
 Byte-stream
app writes bytes
TCP sends
segments
app reads bytes
 Full duplex
 Flow control: keep sender
from overrunning receiver
 Congestion control: keep
sender from overrunning
network
Application process
Write
bytes
TCP
Send buffer
Segment Segment Segment
Transmit segments
Application process
Read
bytes
TCP
Receive buffer
■ ■ ■
Segment Format
Options (variable)
Data
Checksum
SrcPort DstPort
HdrLen 0 Flags
UrgPtr
AdvertisedWindow
SequenceNum
Acknow ledgment
0 4 10 16 31
Segment Format (cont)
 Each connection identified with 4-tuple:
(SrcPort, SrcIPAddr, DsrPort, DstIPAddr)
 Sliding window + flow control
acknowledgment, SequenceNum, AdvertisedWinow
 Flags
SYN, FIN, RESET, PUSH, URG, ACK
 Checksum
pseudo header + TCP header + data
Sender
Data (SequenceNum)
Acknow ledgment +
AdvertisedWindow
Receiver
Connection Establishment and Three-Way Handshake
Active participant
(client)
Passive participant
(server)
Reliability and Flow Control
The receiver’s buffer has two purposes
Reorder segments received out of order
Hold data unread by the application
The sender cannot send more than
AdvertisedWindow bytes of unacknowledged
data at any given time (Flow Control).
The sender retransmits after timeout
Adaptive RTT measurement.
Socket API
 Creating a socket
int socket(int domain, int type, int protocol)
type = SOCK_STREAM, SOCK_DGRAM, SOCK_RAW
 Passive Open (on server)
int bind(int socket, struct sockaddr *addr, int addr_len)
int listen(int socket, int backlog)
int accept(int socket, struct sockaddr *addr, int addr_len)
 Active Open (on client)
int connect(int socket, struct sockaddr *addr,
int addr_len)
 Sending/Receiving Messages
int send(int socket, char *msg, int mlen, int flags)
int recv(int socket, char *buf, int blen, int flags)
Wireless LAN
Ethernet Overview
The most successful Local Area Networks
Bandwidth: 10Mbps, 100Mbps (Fast), 1Gbps
Avoid Simultaneous on a Shared Line:
CSMA/CD
multiple access
carrier sense:
listen before transmitting.
distinguish an idle and busy link.
collision detection
listen while transmitting.
Collision: What you hear is different from what you listen
Ethernet Frame
 Frame Format
 Addresses
unique, 48-bit unicast address assigned to each adapter
example: 8:0:e4:b1:2
Every body hears the frame (shared media). But the one with
matching destination address picks up.
broadcast: all 1s
multicast: first bit is 1. The host can configure its adaptor to
accept some multicast addresses
 Preamble (a seq. alternating 0s and 1s ) indicates the
start of a frame
 Type: high-level protocols
Dest
addr
64 48 32
CRC
Preamble Src
addr
Type Body
16
48
Transmit Algorithm
If line is idle…
send immediately
upper bound message size of 1500 bytes
Limited occupancy on the line.
must wait 9.6us between back-to-back frames
To allow other hosts to send.
If line is busy…
wait until idle and transmit immediately
Collisions
(a)
(b)
(c)
A B
A B
A B
A B
(d)
The remote side may
send its frame before it
hears the frame currently
being sent
Both sides detect an idle
line
Due to the propagation
delay
For A to detect the
collision
Collisions can only be
detected during
transmission
51.2us •10Mbps = 64
bytes
Upon Collision
Send 32 jam bits, then stop transmitting frame
To ensure other hosts to detect conllision
minimum frame is 64 bytes (header + 46 bytes
of data)
delay and try again: exponential backoff
1st time: 0 or 51.2us selected at random
2nd time: 0, 51.2, or 102.4us
nth time: k x 51.2us, for randomly selected
k=0..2n - 1
give up after several tries (usually 16)
Wireless LANs
IEEE 802.11
Bandwidth: 1 - 11 Mbps
Physical Media
diffused infrared (10m)
Diffused: the sender do not need a clear line of sight.
spread spectrum radio (2.4GHz): 11 Mbps 
54Mbps
Wireless LAN configuration
LAN
Server
Wireless
LAN
Laptops
Base station/
access point
Palmtop
radio obstruction
A B C
D
E
Infrastructure mode
mobile terminal
access point
fixed
terminal
application
TCP
802.11 PHY
802.11 MAC
IP
802.3 MAC
802.3 PHY
application
TCP
802.3 PHY
802.3 MAC
IP
802.11 MAC
802.11 PHY
LLC
infrastructure
network
LLC LLC
Supporting Mobility
Case 1: ad hoc networking
Case 2: access points (AP)
Tethered
each mobile node associates with an AP (base
station)
Mobile nodes sends to AP first; AP forwards
B
H
A
F
G
D
AP-2
AP-3
AP-1
C E
Distribution system
Collisions Avoidance
 Similar to Ethernet: Wait until link idle
 Problem: hidden and exposed nodes
A  C; C  B;
Collides at B
A, C cannot detect: hidden nodes
B  A; C  D;
C assumes collision
Actually no collision at A or D
 Cannot (listen) detect collision when transmit
A B C D
802.11 MAC
 Priorities
 defined through different inter frame spaces
 no guaranteed, hard priorities
 SIFS (Short Inter Frame Spacing)
 highest priority, for ACK, CTS, polling response
 PIFS (PCF IFS)
 medium priority, for time-bounded service using PCF
 DIFS (DCF, Distributed Coordination Function IFS)
 lowest priority, for asynchronous data service
t
medium busy
SIFS
PIFS
DIFS
DIFS
next frame
contention
direct access if
medium is free  DIFS
802.11 CSMA/CA
t
medium busy
DIFS
DIFS
next frame
contention window
(randomized back-off
mechanism)
 station ready to send starts sensing the medium (Carrier Sense based
on CCA, Clear Channel Assessment)
 if the medium is free for the duration of an Inter-Frame Space (IFS), the
station can start sending (IFS depends on service type)
 if the medium is busy, the station has to wait for a free IFS, then the
station must additionally wait a random back-off time (collision
avoidance, multiple of slot-time)
 if another station occupies the medium during the back-off time of the
station, the back-off timer stops (fairness)
slot time
direct access if
medium is free  DIFS
802.11 CSMA/CA: contention resolution
t
busy
boe
station1
station2
station3
station4
station5
packet arrival at MAC
DIFS
boe
boe
boe
busy
elapsed backoff time
bor
residual backoff time
busy medium not idle (frame, ack etc.)
bor
bor
DIFS
boe
boe
boe bor
DIFS
busy
busy
DIFS
boe busy
boe
boe
bor
bor
802.11 CSMA/CA: detailed
 Sending unicast packets
station has to wait for DIFS before sending data
receivers acknowledge at once (after waiting for SIFS) if the packet
was received correctly (CRC)
automatic retransmission of data packets in case of transmission
errors
t
SIFS
DIFS
data
ACK
waiting time
other
stations
receiver
sender
data
DIFS
contention
Multiple Access with Collision Avoidance (MACA)
 Sender transmits RequestToSend (RTS) frame
Specifying how long to hold the medium
 Receiver replies with ClearToSend (CTS) frame
 Neighbors…
see CTS: keep quiet
see RTS but not CTS: receiver cannot hear me, ok to
transmit
 Receive sends ACK when has frame
neighbors silent until see ACK
 Collisions
no collisions detection
known when don’t receive CTS or ACK
The cost of collision with RTS/CTS is much smaller
exponential backoff
802.11: RTS & CTS
 Sending unicast packets
 station can send RTS with reservation parameter after waiting for DIFS
(reservation determines amount of time the data packet needs the medium)
 acknowledgement via CTS after SIFS by receiver (if ready to receive)
 sender can now send data at once, acknowledgement via ACK
 other stations store medium reservations distributed via RTS and CTS
t
SIFS
DIFS
data
ACK
defer access
other
stations
receiver
sender
data
DIFS
contention
RTS
CTS
SIFS SIFS
NAV (RTS)
NAV (CTS)
Mobility (cont)
Scanning (selecting an AP)
node sends Probe frame
all AP’s w/in reach reply with ProbeResponse frame
node selects one AP; sends it AssociateRequest
frame
AP replies with AssociationResponse frame
When
active: when join or move
Signal with old AP weakened
new AP informs old AP via tethered network
passive: AP periodically sends Beacon frame
Ad

More Related Content

Similar to Chapter_3_Networking.ppt (20)

Networks A2
Networks  A2Networks  A2
Networks A2
aeneas
 
Fundamentals of Networking
Fundamentals of NetworkingFundamentals of Networking
Fundamentals of Networking
Israel Marcus
 
Internetworking
InternetworkingInternetworking
Internetworking
Mahendhirakumar C
 
ComNet-Ethernet101.GW (1) routing and switching.pptx
ComNet-Ethernet101.GW (1) routing and switching.pptxComNet-Ethernet101.GW (1) routing and switching.pptx
ComNet-Ethernet101.GW (1) routing and switching.pptx
azkamurat
 
TCP/IP Protocol Architeture
TCP/IP Protocol ArchitetureTCP/IP Protocol Architeture
TCP/IP Protocol Architeture
Manoj Kumar
 
Introduction to networking
Introduction to networkingIntroduction to networking
Introduction to networking
Mohsen Sarakbi
 
Socket Programming TCP:IP PPT.pdf
Socket Programming TCP:IP PPT.pdfSocket Programming TCP:IP PPT.pdf
Socket Programming TCP:IP PPT.pdf
PraveenKumar187040
 
lecture-2-tcp-ip.ppt
lecture-2-tcp-ip.pptlecture-2-tcp-ip.ppt
lecture-2-tcp-ip.ppt
KrishnaGupta717939
 
Networking basics
Networking basicsNetworking basics
Networking basics
Sridhar Baithi
 
Computer networking (nnm)
Computer networking (nnm)Computer networking (nnm)
Computer networking (nnm)
nnmaurya
 
Lecture1, TCP/IP
Lecture1, TCP/IPLecture1, TCP/IP
Lecture1, TCP/IP
csyuhk
 
16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)
Jeff Green
 
More on Tcp/Ip
More on Tcp/IpMore on Tcp/Ip
More on Tcp/Ip
Rakhi Saxena
 
computerNetworkSecurity.ppt
computerNetworkSecurity.pptcomputerNetworkSecurity.ppt
computerNetworkSecurity.ppt
ChandrasekharBehera16
 
210202021018701 suratNetworkSecurity.ppt
210202021018701 suratNetworkSecurity.ppt210202021018701 suratNetworkSecurity.ppt
210202021018701 suratNetworkSecurity.ppt
jayvagasiya136
 
Training Day Slides
Training Day SlidesTraining Day Slides
Training Day Slides
adam_merritt
 
Tcp
TcpTcp
Tcp
giaolvq
 
OSI model.pptx
OSI model.pptxOSI model.pptx
OSI model.pptx
SmtArunaAsafAliGovtP
 
group11_DNAA:protocol stack and addressing
group11_DNAA:protocol stack and addressinggroup11_DNAA:protocol stack and addressing
group11_DNAA:protocol stack and addressing
Anitha Selvan
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
SMC Networks Europe
 
Networks A2
Networks  A2Networks  A2
Networks A2
aeneas
 
Fundamentals of Networking
Fundamentals of NetworkingFundamentals of Networking
Fundamentals of Networking
Israel Marcus
 
ComNet-Ethernet101.GW (1) routing and switching.pptx
ComNet-Ethernet101.GW (1) routing and switching.pptxComNet-Ethernet101.GW (1) routing and switching.pptx
ComNet-Ethernet101.GW (1) routing and switching.pptx
azkamurat
 
TCP/IP Protocol Architeture
TCP/IP Protocol ArchitetureTCP/IP Protocol Architeture
TCP/IP Protocol Architeture
Manoj Kumar
 
Introduction to networking
Introduction to networkingIntroduction to networking
Introduction to networking
Mohsen Sarakbi
 
Socket Programming TCP:IP PPT.pdf
Socket Programming TCP:IP PPT.pdfSocket Programming TCP:IP PPT.pdf
Socket Programming TCP:IP PPT.pdf
PraveenKumar187040
 
Computer networking (nnm)
Computer networking (nnm)Computer networking (nnm)
Computer networking (nnm)
nnmaurya
 
Lecture1, TCP/IP
Lecture1, TCP/IPLecture1, TCP/IP
Lecture1, TCP/IP
csyuhk
 
16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)
Jeff Green
 
210202021018701 suratNetworkSecurity.ppt
210202021018701 suratNetworkSecurity.ppt210202021018701 suratNetworkSecurity.ppt
210202021018701 suratNetworkSecurity.ppt
jayvagasiya136
 
Training Day Slides
Training Day SlidesTraining Day Slides
Training Day Slides
adam_merritt
 
group11_DNAA:protocol stack and addressing
group11_DNAA:protocol stack and addressinggroup11_DNAA:protocol stack and addressing
group11_DNAA:protocol stack and addressing
Anitha Selvan
 

Recently uploaded (20)

DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Ad

Chapter_3_Networking.ppt

  • 1. Chapter 3: Networking and Internetworking  Concepts  Switching  Routing (IP)  End-to-End Protocols (UDP/TCP)  Wireless LAN
  • 3. Building Blocks Nodes: PC, special-purpose hardware… hosts switches Links: coax cable, optical fiber… point-to-point multiple access ■ ■ ■ (a) (b)
  • 4. Switched Networks two or more nodes connected by a link, or two or more networks connected by a node A network can be defined recursively as...
  • 5. Simplified view of the QMW Computer Science network (in mid-2000) file compute dialup hammer henry hotpoint 138.37.88.230 138.37.88.162 bruno 138.37.88.249 router/ sickle 138.37.95.241 138.37.95.240/29 138.37.95.249 copper 138.37.88.248 firewall web 138.37.95.248/29 server desktop computers138.37.88.xx subnet subnet Eswitch 138.37.88 server server server 138.37.88.251 custard 138.37.94.246 desktop computers Eswitch 138.37.94 hub hub Student subnet Staff subnet other servers router/ firewall 138.37.94.251 % 1000 Mbps Ethernet Eswitch: Ethernet switch 100 Mbps Ethernet file server/ gateway printers Campus router Campus router 138.37.94.xx
  • 6. Firewall configurations Internet Router/ Protected intranet a) Filtering router Internet b) Filtering router and bastion filter Internet R/filter c) Screened subnet for bastion R/filter Bastion R/filter Bastion w eb/ftp server w eb/ftp server w eb/ftp server
  • 7. Addressing and Routing Address: byte-string that identifies a node usually unique Routing: process of forwarding messages to the destination node based on its address Types of addresses unicast: node-specific broadcast: all nodes on the network multicast: some subset of nodes on the network
  • 8. Inter-Process Communication  Turn host-to-host connectivity into process-to-process communication.  Fill gap between what applications expect and what the underlying technology provides. Host Host Host Channel Application Host Application Host
  • 9. Multiplexing Circuit switching: carry bit streams original telephone network Packet switching: store-and-forward messages Internet L2 L3 R2 R3 L1 R1 Sw itch 1 Sw itch 2
  • 10. Statistical Multiplexing  On-demand time-division  Schedule link on a per-packet basis  Packets from different sources interleaved on link  Buffer packets that are contending for the link  Buffer (queue) overflow is called congestion ■ ■ ■
  • 11. What Goes Wrong in the Network? Bit-level errors (electrical interference) Packet-level errors (congestion) Link and node failures Packets are delayed Packets are deliver out-of-order Third parties eavesdrop
  • 12. Conceptual layering of protocol software Layer n Layer 2 Layer 1 Message sent Message received Communication medium Sender Recipient
  • 13. Protocol layers in the ISO Open Systems Interconnection (OSI) model Application Presentation Session Transport Netw ork Data link Physical Message sent Message received Sender Recipient Layers Communication medium most peer-to-peer communication is indirect peer-to-peer is direct only at hardware level
  • 14. Encapsulation as it is applied in layered protocols Presentation header Application-layer message Session header Transport header Netw ork header
  • 15. ISO Architecture One or more nodes w ithin the netw ork End host Application Presentation Session Transport Netw ork Data link Physical Netw ork Data link Physical Netw ork Data link Physical End host Application Presentation Session Transport Netw ork Data link Physical
  • 16. OSI protocol summary Layer Description Examples Application Protocols that are designed to meet the communication requirements of specific applications, often defining the interface to a service. HTTP,FTP, SMTP, CORBA IIOP Presentation Protocols at this level transmit data in a network representation that is independent of the representations used in individual computers, which may differ. Encryption is also performed in this layer, if required. Secure Sockets (SSL),CORBA Data Rep. Session At this level reliability and adaptation are performed, such as detection of failures and automatic recovery. Transport This is the lowest level at which messages (rather than packets) are handled. Messages are addressed to communication ports attached to processes, Protocols in this layer may be connection-oriented or connectionless. TCP, UDP Network Transfers data packets between computers in a specific network. In a WAN or an internetwork this involves the generation of a route passing through routers. In a single LAN no routing is required. IP, ATM virtual circuits Data link Responsible for transmission of packets between nodes that are directly connected by a physical link. In a WAN transmission is between pairs of routers or between routers and hosts. In a LAN it is between any pair of hosts. Ethernet MAC, ATM cell transfer, PPP Physical The circuits and hardware that drive the network. It transmits sequences of binary data by analogue signalling, using amplitude or frequency modulation of electrical signals (on cable circuits), light signals (on fibre optic circuits) or other electromagnetic signals (on radio and microwave circuits). Ethernet base- band signalling, ISDN
  • 17. TCP/IP layers Messages (UDP) or Streams (TCP) Application Transport Internet UDP or TCP packets IP datagrams Network-specific frames Message Layers Underlying network Network interface
  • 18. Encapsulation in a message transmitted via TCP over an Ethernet Application message TCP header IP header Ethernet header Ethernet frame port TCP IP
  • 19. The programmer's conceptual view of a TCP/IP Internet IP Application Application TCP UDP
  • 20. Internet Architecture Hourglass Design Application vs Application Protocol (FTP, HTTP) ■ ■ ■ FTP TCP UDP IP NET 1 NET2 NET n HTTP SMTP TFTP
  • 21. Protocol Multiplexing Multiplexing and Demultiplexing (demux key) Encapsulation (header/body) Host Host Application program Application program RRP Data Data HHP RRP HHP Application program Application program RRP Data RRP Data HHP RRP Data
  • 23. Scalable Networks  Switch Connect links to form a larger network. Connect switches to form a larger network. forwards packets from input port to output port port selected based on address in packet header  Advantages store and forward support large numbers of hosts
  • 24. Datagram Switching  No connection setup phase Sometimes called connectionless model  Each packet forwarded independently  Each switch maintains a forwarding (routing) table Eg. Switch 1 0 1 3 2 0 1 3 2 0 1 3 2 Sw itch 3 Host B Sw itch 2 Host A Sw itch 1 Host C Host D Host E Host F Host G Host H Address Port A 2 C 3 F 1 G 1 … …
  • 25. Datagram Model  Source host has no way of knowing if the network is capable of delivering a packet or if the destination host is even up. No QoS  Since packets are treated independently, it is possible to route around link and node failures.  Since every packet must carry the full address of the destination, the overhead per packet is higher than for the connection-oriented model.
  • 26. Do not forward to all the other ports (broadcast) when unnecessary Maintain forwarding table Host Port A 1 B 1 C 1 X 2 Y 2 Z 2 Learn table entries based on source address Table is an optimization; need not be complete Always forward broadcast frames Learning Bridges A Bridge B C X Y Z Port 1 Port 2
  • 28. Internetworking Concatenation of Different Networks R2 R1 H4 H5 H3 H2 H1 Netw ork 2 (Ethernet) Netw ork 1 (Ethernet) H6 Netw ork 4 (point-to-point) H7 R3 H8 Netw ork 3 (FDDI)
  • 29. IP Internet  Connecting Problem 1: Heterogeneity of Networks Solution: Layered Protocol Stack (IP over …… )  Problem 2: Scalability in Routing and Addressing Solution: Address Hierarchy R1 R2 R3 H1 H8 ETH FDDI IP ETH TCP FDDI PPP PPP ETH IP ETH TCP IP IP IP
  • 30. Service Model  Connectionless (datagram-based)  Best-effort delivery (unreliable service) packets can be lost, delayed, duplicated, delivered out of order.  Datagram format: IP header Version HLen TOS Length Ident Flags Offset TTL Protocol Checksum SourceAddr DestinationAddr Options (variable) Pad (variable) 0 4 8 16 19 31 Data
  • 31. IP Header  Version (always set to the value 4 for IP v4)  IP Header Length (number of 32 -bit words forming the header, usually five)  Size of Datagram (in bytes, header + data)  Flags 3 bits: R (reserved bit set to 0) DF (Don't fragment ) MF (More fragments)  Time To Live (Number of hops /links which the packet may be routed over, decremented by most routers - used to prevent accidental routing loops)  Protocol (the type of transport packet being carried (e.g. 1 = ICMP; 6 = TCP; 17= UDP).  Header Checksum (A 1's complement checksum of IP header, updated whenever the packet header is modified by a node. Packets with an invalid checksum are discarded by all nodes in an IP network)  Source Address / Destination Address
  • 32. Internet address structure, showing field sizes in bits 7 24 Class A: 0 Netw ork ID Host ID 14 16 Class B: 1 0 Netw ork ID Host ID 21 8 Class C: 1 1 0 Netw ork ID Host ID 28 Class D(multicast): 1 1 1 0 Multicast address 27 Class E(reserved): 1 1 1 1 unused 0 globally unique hierarchical: network + host
  • 33. Decimal representation of Internet addresses octet 1 octet 2 octet 3 Class A: 1 to 127 0 to 255 0 to 255 1 to 254 Class B: 128 to 191 Class C: 192 to 223 224 to 239 Class D (multicast): Network ID Network ID Network ID Host ID Host ID Host ID Multicast address 0 to 255 0 to 255 1 to 254 0 to 255 0 to 255 0 to 255 0 to 255 0 to 255 0 to 255 Multicast address 0 to 255 0 to 255 1 to 254 240 to 255 Class E (reserved): 1.0.0.0 to 127.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 223.255.255.255 224.0.0.0 to 239.255.255.255 240.0.0.0 to 255.255.255.255 Range of addresses
  • 34. Every datagram contains destination’s address if connected to destination network, then forward to the host in LAN If network number of destination IP == my network number if not directly connected, then forward to the host’s default router Each router maintains a forwarding table forwarding table maps network number (rather than host address) into next hop or interface number (if directly connected) Datagram Forwarding Strategy
  • 35. Traffic: H1 → H3, H1 → H8 R1: default router is R2 R2 Routing Table: Network Number Next Hop Interface 1 R3 interface 1 2 R1 interface 0 3 - interface 1 4 - interface 0 R2 R1 H4 H5 H3 H2 H1 Netw ork 2 (Ethernet) Netw ork 1 (Ethernet) H6 Netw ork 4 (point-to-point) H7 R3 H8 Netw ork 3 (FDDI)
  • 36. Address Translation in LAN  Map IP addresses into physical addresses of the destination host (if connected directly) or the next hop router  ARP Each host caches its table of IP to physical address bindings table entries are discarded if not refreshed timeout in about 10 minutes broadcast request if IP address not in table target machine send its physical address to the sender target machine also updates add entry of the source in its table It is likely that the target will send IP packets to the source later on. Other hosts (who receives the broadcasted request) update table if already have an entry
  • 37. End-to-End Protocols  Underlying best-effort network drop messages re-orders messages delivers duplicate copies of a given message limits packet (not message) to some finite size delivers messages after an arbitrarily long delay  Common end-to-end services guarantee message delivery deliver messages in the same order they are sent deliver at most one copy of each message support arbitrarily large messages support synchronization between sender and receiver allow the receiver to flow control the sender support multiple application processes on each host
  • 39. Simple Demultiplexor (UDP)  Unreliable and unordered datagram service  Adds multiplexing  No flow control or error control no need for sender-side buffer)  Endpoints identified by ports servers listens at well-known ports! see /etc/services on Unix  Header format  Optional checksum psuedo header (IP.src, IP.dsest, IP.proto, UDP.len) + UDP header + data SrcPort DstPort Checksum Length Data 0 16 31
  • 40. TCP Overview  Connection- oriented  Byte-stream app writes bytes TCP sends segments app reads bytes  Full duplex  Flow control: keep sender from overrunning receiver  Congestion control: keep sender from overrunning network Application process Write bytes TCP Send buffer Segment Segment Segment Transmit segments Application process Read bytes TCP Receive buffer ■ ■ ■
  • 41. Segment Format Options (variable) Data Checksum SrcPort DstPort HdrLen 0 Flags UrgPtr AdvertisedWindow SequenceNum Acknow ledgment 0 4 10 16 31
  • 42. Segment Format (cont)  Each connection identified with 4-tuple: (SrcPort, SrcIPAddr, DsrPort, DstIPAddr)  Sliding window + flow control acknowledgment, SequenceNum, AdvertisedWinow  Flags SYN, FIN, RESET, PUSH, URG, ACK  Checksum pseudo header + TCP header + data Sender Data (SequenceNum) Acknow ledgment + AdvertisedWindow Receiver
  • 43. Connection Establishment and Three-Way Handshake Active participant (client) Passive participant (server)
  • 44. Reliability and Flow Control The receiver’s buffer has two purposes Reorder segments received out of order Hold data unread by the application The sender cannot send more than AdvertisedWindow bytes of unacknowledged data at any given time (Flow Control). The sender retransmits after timeout Adaptive RTT measurement.
  • 45. Socket API  Creating a socket int socket(int domain, int type, int protocol) type = SOCK_STREAM, SOCK_DGRAM, SOCK_RAW  Passive Open (on server) int bind(int socket, struct sockaddr *addr, int addr_len) int listen(int socket, int backlog) int accept(int socket, struct sockaddr *addr, int addr_len)  Active Open (on client) int connect(int socket, struct sockaddr *addr, int addr_len)  Sending/Receiving Messages int send(int socket, char *msg, int mlen, int flags) int recv(int socket, char *buf, int blen, int flags)
  • 47. Ethernet Overview The most successful Local Area Networks Bandwidth: 10Mbps, 100Mbps (Fast), 1Gbps Avoid Simultaneous on a Shared Line: CSMA/CD multiple access carrier sense: listen before transmitting. distinguish an idle and busy link. collision detection listen while transmitting. Collision: What you hear is different from what you listen
  • 48. Ethernet Frame  Frame Format  Addresses unique, 48-bit unicast address assigned to each adapter example: 8:0:e4:b1:2 Every body hears the frame (shared media). But the one with matching destination address picks up. broadcast: all 1s multicast: first bit is 1. The host can configure its adaptor to accept some multicast addresses  Preamble (a seq. alternating 0s and 1s ) indicates the start of a frame  Type: high-level protocols Dest addr 64 48 32 CRC Preamble Src addr Type Body 16 48
  • 49. Transmit Algorithm If line is idle… send immediately upper bound message size of 1500 bytes Limited occupancy on the line. must wait 9.6us between back-to-back frames To allow other hosts to send. If line is busy… wait until idle and transmit immediately
  • 50. Collisions (a) (b) (c) A B A B A B A B (d) The remote side may send its frame before it hears the frame currently being sent Both sides detect an idle line Due to the propagation delay For A to detect the collision Collisions can only be detected during transmission 51.2us •10Mbps = 64 bytes
  • 51. Upon Collision Send 32 jam bits, then stop transmitting frame To ensure other hosts to detect conllision minimum frame is 64 bytes (header + 46 bytes of data) delay and try again: exponential backoff 1st time: 0 or 51.2us selected at random 2nd time: 0, 51.2, or 102.4us nth time: k x 51.2us, for randomly selected k=0..2n - 1 give up after several tries (usually 16)
  • 52. Wireless LANs IEEE 802.11 Bandwidth: 1 - 11 Mbps Physical Media diffused infrared (10m) Diffused: the sender do not need a clear line of sight. spread spectrum radio (2.4GHz): 11 Mbps  54Mbps
  • 53. Wireless LAN configuration LAN Server Wireless LAN Laptops Base station/ access point Palmtop radio obstruction A B C D E
  • 54. Infrastructure mode mobile terminal access point fixed terminal application TCP 802.11 PHY 802.11 MAC IP 802.3 MAC 802.3 PHY application TCP 802.3 PHY 802.3 MAC IP 802.11 MAC 802.11 PHY LLC infrastructure network LLC LLC
  • 55. Supporting Mobility Case 1: ad hoc networking Case 2: access points (AP) Tethered each mobile node associates with an AP (base station) Mobile nodes sends to AP first; AP forwards B H A F G D AP-2 AP-3 AP-1 C E Distribution system
  • 56. Collisions Avoidance  Similar to Ethernet: Wait until link idle  Problem: hidden and exposed nodes A  C; C  B; Collides at B A, C cannot detect: hidden nodes B  A; C  D; C assumes collision Actually no collision at A or D  Cannot (listen) detect collision when transmit A B C D
  • 57. 802.11 MAC  Priorities  defined through different inter frame spaces  no guaranteed, hard priorities  SIFS (Short Inter Frame Spacing)  highest priority, for ACK, CTS, polling response  PIFS (PCF IFS)  medium priority, for time-bounded service using PCF  DIFS (DCF, Distributed Coordination Function IFS)  lowest priority, for asynchronous data service t medium busy SIFS PIFS DIFS DIFS next frame contention direct access if medium is free  DIFS
  • 58. 802.11 CSMA/CA t medium busy DIFS DIFS next frame contention window (randomized back-off mechanism)  station ready to send starts sensing the medium (Carrier Sense based on CCA, Clear Channel Assessment)  if the medium is free for the duration of an Inter-Frame Space (IFS), the station can start sending (IFS depends on service type)  if the medium is busy, the station has to wait for a free IFS, then the station must additionally wait a random back-off time (collision avoidance, multiple of slot-time)  if another station occupies the medium during the back-off time of the station, the back-off timer stops (fairness) slot time direct access if medium is free  DIFS
  • 59. 802.11 CSMA/CA: contention resolution t busy boe station1 station2 station3 station4 station5 packet arrival at MAC DIFS boe boe boe busy elapsed backoff time bor residual backoff time busy medium not idle (frame, ack etc.) bor bor DIFS boe boe boe bor DIFS busy busy DIFS boe busy boe boe bor bor
  • 60. 802.11 CSMA/CA: detailed  Sending unicast packets station has to wait for DIFS before sending data receivers acknowledge at once (after waiting for SIFS) if the packet was received correctly (CRC) automatic retransmission of data packets in case of transmission errors t SIFS DIFS data ACK waiting time other stations receiver sender data DIFS contention
  • 61. Multiple Access with Collision Avoidance (MACA)  Sender transmits RequestToSend (RTS) frame Specifying how long to hold the medium  Receiver replies with ClearToSend (CTS) frame  Neighbors… see CTS: keep quiet see RTS but not CTS: receiver cannot hear me, ok to transmit  Receive sends ACK when has frame neighbors silent until see ACK  Collisions no collisions detection known when don’t receive CTS or ACK The cost of collision with RTS/CTS is much smaller exponential backoff
  • 62. 802.11: RTS & CTS  Sending unicast packets  station can send RTS with reservation parameter after waiting for DIFS (reservation determines amount of time the data packet needs the medium)  acknowledgement via CTS after SIFS by receiver (if ready to receive)  sender can now send data at once, acknowledgement via ACK  other stations store medium reservations distributed via RTS and CTS t SIFS DIFS data ACK defer access other stations receiver sender data DIFS contention RTS CTS SIFS SIFS NAV (RTS) NAV (CTS)
  • 63. Mobility (cont) Scanning (selecting an AP) node sends Probe frame all AP’s w/in reach reply with ProbeResponse frame node selects one AP; sends it AssociateRequest frame AP replies with AssociationResponse frame When active: when join or move Signal with old AP weakened new AP informs old AP via tethered network passive: AP periodically sends Beacon frame