CN Diagrams
CN Diagrams
Protocol Stack
Layered Architecture
OSI layers
Hop to Hop delivery of data link layer
Network Layer
Network Layer: end to end delivery
Transport Layer
Transport Layer: process to process delivery
Introduction 1-5
Summary of OSI Layers
Introduction 1-6
Internet protocol stack
• application: supporting network
applications application
• FTP, SMTP, HTTP
• transport: process-process data transfer transport
• TCP, UDP
• network: routing of datagrams from network
source to destination
• IP, routing protocols
link
• link: data transfer between neighboring
network elements
• Ethernet
physical
• physical: bits “on the wire”
Introduction 1-7
message M
source
applicatio
Encapsulation
segment Ht M n
datagram Hn Ht M transport
frame Hl Hn Ht M network
link
physical link
physical
switch
destination Hn Ht M network
M applicatio
Hl Hn Ht M link Hn Ht M
Ht M n physical
Hn Ht M transport
Hl Hn Ht M network router
link
physical
Introduction 1-8
Flow characteristics
FIFO queue
Priority queuing
Weighted fair queuing
Leaky bucket
Leaky bucket implementation
5-34
Passive Attacks
Active Attacks
A C
src:B dest:A
payload B
src:B dest:A
payload
B
Introduction 1-14
MODULE 2
Introduction 1-15
Figure : Keeping user state with cookies
In a typical FTP session, the user is sitting in front of one host (the local host) and wants
to transfer files to or from a remote host. In order for the user to access the remote
account, the user must provide a user identification and a password. After providing this
authorization information, the user can transfer files from the local file system to the
remote file system and vice versa. As shown in Figur , the user interacts with FTP
through an FTP user agent. The user first provides the hostname of the remote host,
causing the FTP client process in the local host to establish a TCP connection with the
FTP server process in the remote host. The user then provides the user identification and
password, which are sent over the TCP connection as part of FTP commands. Once the
server has authorized the user, the user copies one or more files stored in the local file
system into the remote file system (or vice versa).
Figure: FTP moves files between local and remote file systems
18
6. Electronic Mail in the Internet
SMTP is the principal application-layer protocol for Internet electronic mail. It uses the
reliable data transfer service of TCP to transfer mail from the sender’s mail server to the
recipient’s mail server. As with most application-layer protocols, SMTP has two sides: a
client side, which executes on the sender’s mail server, and a server side, which executes
on the recipient’s mail server. Both the client and server sides of SMTP run on every mail
server. When a mail server sends mail to other mail servers, it acts as an SMTP client.
When a mail server receives mail from other mail servers, it acts as an SMTP server.
1. connection establishment
2. mail transfer
3. Connection termination.
Connection establishment
After a client has made a TCP connection to the well-known port 25, the SMTP server
starts the connection phase.
1. The server sends code 220 (service ready) to tell the client that it is ready to
receive mail. If the server is not ready, it sends code 421 (service not available).
2. The client sends the HELO message to identify itself using its domain name
address. This step is necessary to inform the server of the domain name of the
client.
3. The server responds with code 250 (request command completed) or some
other code depending on the situation.
Message Transfer
After connection has been established between the SMTP client and server, a single
message between a sender and one or more recipients can be exchanged.
1. The client sends the MAIL FROM message to introduce the sender of the
message. It includes the mail address of the sender (mailbox and the domain
name).
2. The server responds with code 250 or some other appropriate code.
20
3. The client sends the RCPT TO (recipient) message, which includes the mail
address of the recipient.
4. The server responds with code 250 or some other appropriate code.
5. The client sends the DATA message to initialize the message transfer.
6. The server responds with code 354 (start mail input) or some other appropriate
message.
7. The client sends the contents of the message in consecutive lines. Each line is
terminated by a two-character end-of-line token (carriage return and line feed).
The message is terminated by a line containing just one period.
8. The server responds with code 250 (OK) or some other appropriate code.
21
Connection Termination
After the message is transferred successfully, the client terminates the connection. This
phase involves two steps.
2. The server responds with code 221 or some other appropriate code.
After the connection termination phase, the TCP connection must be closed.
⦿ SMTP is used to transfer mail from the sender’s mail server to the recipient’s mail
server;
⦿ SMTP is also used to transfer mail from the sender’s user agent to the sender’s
mail server.
⦿ A mail access protocol, such as POP3, is used to transfer mail from the
recipient’s mail server to the recipient’s user agent.
POP3
⦿ POP3 begins when the user agent (the client) opens a TCP connection to the mail
server (the server) on port 110.
⦿ With the TCP connection established, POP3 progresses through three phases’
authorization, transaction, and update.
Application Layer
Application process
url (uniform resource locator)
Persistent Connections
http transaction
HTTp Request
http response message
ftp example
PURPOSE OF DNS
Dns server
• The root, TLD, and authoritative DNS servers all
belong to the hierarchy of DNS servers.
Root DNS servers
Iterative resolution
recursive resolution
Dns message format
Stream of bytes
Segment N Segment 1
H H
IP
header
Frame
header
TCP payload
IP payload
Data-link layer payload
Passive
Active open
open seq: 8000
UAPRS F
SYN
seq: 15000
Connection ack: 8001
opened nd: 5000
U A P R S F rw
SYN + ACK
seq: 8000
ack: 15001
UAPRS F
rwnd: 10000
ACK
Connection Termination
seq: 8001
Send
request ack: 15001
UAPRS F
Data Receive
bytes: 8001-9
000
2
Segements are pushed
4
Flow control feedback
1
cwnd
RTT
2
cwnd
RTT
4
cwnd
RTT
8
cwnd
1
cwnd
RTT
2
cwnd
RTT
4
cwnd
RTT
8
cwnd
2
Segements are pushed
4
Flow control feedback
Shrinking of Windows
Process-to-Process Communication
ICANN Ranges
ICANN has divided the port numbers into three ranges: well-known,
registered, and dynamic (or private)
Process-to-Process Communication
0100101011000001
1
-----------------------
0100101011000010
UDP Checksum
0110011001100000
0101010101010101
1000111100001100
1011010100111101
----------------------------
1111111111111111
Message is accepted.
Transport Layer
81
Socket Addresses
83
Figure 2.26, Go-Back-N protocol
84
Figure 2.22, Connectionless service
86
Figure 2.39, Control field
WINDOWS IN TCP
Send Window
Receive Window
MODULE4 Network Layer
4.4.2 Fragmentation
93
Figure.F , Fragmentation example
Supernet Mask
Two-Level Addressing
98
MODULE IV RLMCA-301 – COMPUTER NETWORKS ADMN 2016-‘18
99
MODULE IV RLMCA-301 – COMPUTER NETWORKS ADMN 2016-‘18
Private Addresses
Figure , Autonomous s y s t e m s
100
MODULE IV RLMCA-301 – COMPUTER NETWORKS ADMN 2016-‘18
101
MODULE IV RLMCA-301 – COMPUTER NETWORKS ADMN 2016-‘18
Areas
102
MODULE IV RLMCA-301 – COMPUTER NETWORKS ADMN 2016-‘18
Figure X 1 , Multicasting
103
MODULE IV RLMCA-301 – COMPUTER NETWORKS ADMN 2016-‘18
Multicast Routing
Source-Based Tree
Network layer
applicatio
• Transport segment from n
transport
datagrams
data link data link
physical physical
105
Interplay between routing and forwarding
value in arriving
packet’s header
0111 1
3 2
VC forwarding table
12 22 32
1 3
2
VC number
interface
forwarding table in number
router:
Incoming interface Incoming VC # Outgoing interface Outgoing VC #
1 12 3 22
2 63 1 18
3 7 2 17
1 97 3 87
… … … …
VC Data Transfer
Datagram networks
application application
transport transport
network 1. send datagrams 2. receive datagrams network
data link data link
physical physical
IP destination address in
arriving packet’s header
1
3 2
otherwise 3
Datagram network
link layer
physical layer
IPv4 datagram format
IP datagram format
IP protocol version 32 bits
number total datagram
header length type of length (bytes)
ver head. length
(bytes) len service for
“type” of data fragment fragmentation/
16-bit identifier flgs
offset reassembly
max number time to upper header
remaining hops live layer checksum
(decremented at
32 bit source IP address
each router)
32 bit destination IP address
upper layer protocol
to deliver payload to options (if any) e.g. timestamp,
record route
how much overhead? data taken, specify
(variable length, list of routers
20 bytes of TCP
typically a TCP to visit.
20 bytes of IP
or UDP segment)
= 40 bytes + app
layer msg
IP fragmentation, reassembly
• Network links have MTU
(max.transfer size) - largest
possible link-level frame
fragmentation:
• different link types,
…
in: one large datagram
different MTUs out: 3 smaller datagrams
• large IP datagram divided
(“fragmented”)
• one datagram reassembly
becomes several
datagrams
• “reassembled” only at
final destination
…
1. Identification
2. Flags
3. Fragmentation offset
20.115
IP fragmentation, reassembly
length ID fragflag offset
example: =4000 =x =0 =0
4000 byte datagram
one large datagram becomes
MTU = 1500 bytes several smaller datagrams
Network mask
Before Subnetting
IPv6 datagram
Routing Protocols
An example of interconnected autonomous systems
Popular routing protocols
z
w x y
A D B
C
routing table in router D
destination subnet next router # hops to dest
w A
2
y B
2
z B
7
x --
1
…. ….
....
A-to-D advertisement
dest next hops
w - 1
x - 1
z C 4
…. … ... z
w x y
A D B
Network Layer 4-127
C
routing table in router D
destination subnet next router # hops to dest
w A
2
A 5
y B
2
z B
7
x --
1
…. ….
....
RIP table processing
routed routed
transport transprt
(UDP) (UDP)
network forwarding forwarding network
(IP) table table (IP)
link link
physical physical
backbone
area
border
routers
area 3
internal
routers
area 1
area 2
4-128
BGP basics
BGP session: two BGP routers (“peers”) exchange BGP
messages:
advertising paths to different destination network prefixes (“path vector”
protocol)
exchanged over semi-permanent TCP connections
3c
BGP
3a message
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
eBGP session
3a iBGP session
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
Type of Errors
Type of Errors(cont’d)
• Single-Bit Error
~ is when only one bit in the data unit has
changed
Type of Errors(cont’d)
• Burst Error
~ means that two or more consecutive bits in
the data unit have changed
Detection
Detection(cont’d)
• Redundancy
Detection(cont’d)
• Detection methods
• VRC(Vertical Redundancy Check)
• LRC(Longitudinal Redundancy)
• CRC(Cyclic redundancy Check)
• Checksum
Detection(cont’d)
• VRC(Vertical Redundancy Check) Row Parity
Detection(cont’d)
Performance
Parity Checking
Two Dimensional Bit
Parity:
Single Bit Parity: Detect and correct single bit errors
Detect single bit errors
0 0
Detection(cont’d)
• CRC(Cyclic Redundancy Check)
~ is based on binary division.
Detection(cont’d)
• CRC generator
~ uses modular-2 division.y Division
in a
CRC Generator
Detection(cont’d)
Binary Division
in a
CRC Checker
Detection(cont’d)
• Polynomials
• CRC generator(divisor) is most often represented
not as a string of 1s and 0s, but as an algebraic
polynomial.
Detection(cont’d)
Detection(cont’d)
• Checksum Generator
ETHERNET
Ethernet Frame
Manchester encoding
5-139
• Used in 10BaseT
• Each bit has a transition
• Allows clocks in sending and receiving nodes to
synchronize to each other
• no need for a centralized, global clock among nodes!
10Base5 implementation
10Base2 implementation
10Base-T implementation
10Base-F implementation
Summary of Standard Ethernet implementations
Responsible framing
and MAC address and
Multiple Access
Control
Frames in a pure ALOHA network
12.143
Procedure for pure ALOHA protocol
12.144
Random Access – Slotted ALOHA
Frames in a slotted ALOHA network
Nonpersistent CSMA
Random
Waiting
times Wasted time
1-persistent CSMA
P-persistent CSMA
12.147
Timing in CSMA/CA
12.148
Reservation access method
Token-passing procedure
Client/Sever Architecture
• Well known,
powerful, reliable
server is a data source
• Clients request data
from server
• Very successful model
• WWW (HTTP), FTP,
Web services, etc.
P2P Architecture
leecher B leecher A I !
have
seed
leecher C
Alice arrives …
… obtains list
of peers from tracker
… and begins exchanging
file chunks with peers in torrent
Function of a repeater
15.153
Hubs
A hierarchy of hubs
Self learning
Switches vs. Routers
155
MODULE 6
Firewalls
firewall
Isolates organization’s internal net from larger Internet, allowing
some packets to pass, blocking others
administered public
network Internet
trusted “good guys” untrusted “bad guys”
firewall
Application gateways
Components of Network management
Architecture
network
managemen
t
protocol
SNMP protocol
managing managing
entity entity
request
trap msg
response
SNMP PDU
PDU Trap
type Enterprise Agent Type
Specific Time
Name Value ….
Addr code stamp
4 (0-7)
Port Monitoring
Virtual Private Network
IPsec Protocol
Tunnel Mode
• In tunnel mode, IPSec protects the entire IP packet.
• It takes an IP packet, including the header, applies IPSec security
methods to the entire packet, and then adds a new IP header.
Transport mode versus tunnel mode
Example SA from R1 to R2
headquarters Internet
branch office
200.168.1.100 193.68.2.23
R1 security association
172.16.1/24
R2
172.16.2/24
200.168.1.100 193.68.2.23
R1 security association
172.16.1/24
R2
172.16.2/24
authenticated Portion
encrypted
new IP ESP original Original IP ESP ESP
header hdr IP hdr datagram payload trl auth
Ipsec Datagram
authenticated
encrypted
new IP ESP original Original IP ESP ESP
header hdr IP hdr datagram payload trl auth
1
6-169
1 1 2 2 AP 2
AP 1 AP 2 AP 1
2 3
3 4
H1 H1
• Station H2, having heard the CTS, refrains from transmitting for
the time specified in the CTS frame.
RTS and CTS
A B
AP
reservation collision
time
2 2 6 6 6 2 6 0 - 2312 4
frame address address address seq address
duration payload CRC
control 1 2 3 control 4
Address 4: used
only in ad hoc
Address 1: MAC address mode
of wireless host or AP Address 3: MAC address
to receive this frame of router interface to which
AP is attached
Address 2: MAC address
of wireless host or AP
transmitting this frame
• Piconet
• Each piconet has one master and up to 7 simultaneous
slaves
• Master : device that initiates a data exchange.
• Slave : device that responds to the master
• Scatternet
• Linking of multiple piconets through the master or slave
devices
• Bluetooth devices have point-to-multipoint capability to
engage in Scatternet communication.
Piconet
Scatternet