Download Review related concept in Computer Networks

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Asynchronous Transfer Mode wikipedia , lookup

Distributed firewall wikipedia , lookup

Zigbee wikipedia , lookup

AppleTalk wikipedia , lookup

Dynamic Host Configuration Protocol wikipedia , lookup

CAN bus wikipedia , lookup

TCP congestion control wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Computer network wikipedia , lookup

Parallel port wikipedia , lookup

Airborne Networking wikipedia , lookup

Network tap wikipedia , lookup

Deep packet inspection wikipedia , lookup

Remote Desktop Services wikipedia , lookup

IEEE 1355 wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Lag wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

UniPro protocol stack wikipedia , lookup

Internet protocol suite wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Transcript
RELATED CONCEPTS IN
COMPUTER NETWORKS
Content
•  Computer Networks
•  OSI and TCP/IP models
•  IP
•  Transport layer, TCP, UDP
•  Network application models
•  Socket concept
Computer Networks
•  Inter-connection of nodes by
mobile network
transport medium following some
architecture:
•  Using a topology: bus, star, ring,
hybrid…
•  Using some communication protocols
global ISP
home
network
institutional
network
regional ISP
OSI and TCP/IP models
OSI model
Application layer
Presentation layer
TCP/IP model
Application
HTTP, FTP, SMTP…
Session layer
Transport layer
Transport layer
Network layer
Network layer
Datalink layer
Datalink layer
Physical layer
Physical layer
OSI and TCP/IP models
•  Application layer: defines communication
between different parts of the same application
•  Presentation layer: application data representation,
data encryption, compression, conversion…
•  Session layer: manages sessions, synchronization,
recovery of data transmission process
•  Transport layer: Transmits data between
applications
•  Network layer: Transmits data between distance
network elements: Taking care of routing and
forwarding data
•  Data link layer: Transmits data between adjacent
network elements.
•  Physical layer: Transmits bits on the medium.
Converting bits to physical form appropriate to
the medium.
Application
Presentation
Session
Transport
Network
Data link
Physical
OSI and TCP/IP models
•  OSI model: reference model
•  TCP model: Internet model
•  Transport layer: TCP/UDP
•  Network layer: IP + routing protocols.
OSI and TCP/IP models
Application layer
Application layer
Presentation layer
Presentation layer
Session layer
Session layer
Transport layer
Transport layer
Network layer
Network layer
Network layer
Data link layer
Data link layer
Physical layer
Physical layer
End system
Intermediate node
End system
Internet protocols mapping on TCP/IP
Aplication
DNS
DHCP
Transport
SNMP
HTTP
UDP
SMTP
...
FTP
TCP
...
Network
Data link
Physical
ICMP
RIP
OSPF
IP
Ethernet
FDDI
Copper
PPP
Optical
DSL
Radio
...
ARP
PSTN
...
OSI and TCP/IP models
•  Layering Makes it Easier
•  Application programmer
•  Doesn’t need to send IP packets
•  Doesn’t need to send Ethernet frames
•  Doesn’t need to know how TCP implements reliability
•  Only need a way to pass the data down
•  Socket is the API to access transport layer functions
IP
•  IP: Internet Protocol
•  Forward data packet between distance network nodes (routers or
hosts)
•  Using routing table built by routing protocols such as OSPF, RIP …
•  IP address
•  Is assigned to each network interface
•  IP v4: 32 bits
•  133.113.215.10
•  IP v6: 128 bits
•  2001:200:0:8803::53
•  A host may have a domain name
•  Conversion IP <-> domain name: DNS
•  Ex: soict.hust.edu.vn <--> 202.191.56.65
IP packet
total datagram
length (words)
IP protocol version
number
header length
(bytes)
QoS support
max number
remaining hops
(decremented at
each router)
upper layer protocol
to deliver payload to
32 bits
ver head.
len
DS
16-bit identifier
upper
time to
layer
live
length
fragment
flgs
offset
header
checksum
for
fragmentation/
reassembly
32 bit source IP address
32 bit destination IP address
E.g. timestamp,
record route
taken, specify
list of routers
to visit.
Options (if any)
data
(variable length,
typically a TCP
or UDP segment)
11
12
Transport layer: Mux/Demux
HTTP
FTP
Multiplexing
Chat
Application HTTP
protocol
Transport layer
protocol
Network layer protocol
FTP
Chat
Demultiplexing
13
Transport layer: Mux/Demux
•  How data from different
applications between two hosts
can be delivered to right
application?
•  Each application process is
assigned a transport port (16 bits)
•  Application sends data to the
transport layer through the port.
•  Socket:
•  Application access point for
application
•  It is a combination of (Address IP,
transportnport)
32 bits
source port #
dest port #
other header fields
Application data
(message)
TCP/UDP segment format
Transport layer: UDP
•  MUX/DeMUX
•  Best effort
•  Connectionless
32 bits
source port #
length
dest port #
checksum
•  Send independent datagrams
•  Drop error datagrams
•  No congestion control
Application
data
(message)
15
UDP mux/demux
Each process uses a port to communicate with other
process.
Host B
Host A
Host C
application
application
application
P1
P2
P3
transport
transport
transport
network
network
link
network
link
physical
link
physical
physical
source port: 6428
dest port: 9157
source port: 9157
dest port: 6428
source port: 6428
dest port: 5775
source port: 5775
dest port: 6428
Transport layer: TCP
•  Connection oriented protocol
•  3-step connection opening
A
B
•  Reliable protocol
•  Re-transmission on error
•  Flow control
SYN
•  Congestion control
ACK/SYN
ACK
Transport layer: TCP
32 bits
URG: Urgent data
ACK: ACK #
source port #
sequence number
acknowledgement number
head not
len used U A P R S F
checksum
RST, SYN, FIN packet
-For reliable transmission
- In Byte
dest port #
Receive window
Urg data pnter
- For flow control
- In Byte
Options (variable length)
application
data
(variable length)
17
18
TCP mux/demux
application
application
P4
P3
P5
application
P6
P3
P2
transport
network
network
link
network
link
physical
link
physical
client: IP
address A
transport
transport
server: IP
address B
source IP,port: B,6000
dest IP,port: A,9157
source IP,port: A,9157
dest IP, port: B,6000
physical
source IP,port: C,5775
dest IP,port: B,6000
source IP,port: C,9157
dest IP,port: B,6000
client: IP
address C
19
TCP mux/demux
multi-thread
application
application
P3
application
P4
P3
P2
transport
network
network
link
network
link
physical
link
physical
client: IP
address A
transport
transport
server: IP
address B
source IP,port: B,80
dest IP,port: A,9157
source IP,port: A,9157
dest IP, port: B,80
physical
source IP,port: C,5775
dest IP,port: B,80
source IP,port: C,9157
dest IP,port: B,80
client: IP
address C
20
Life cycle of TCP connection
Wait
Server application
Creates a listen socket
CLOSED
Send SYN
TIME_WAIT
Receive FIN
Send ACK
SYN_SENT
Receive SYN/ACK
Send ACK
FIN_WAIT_2
Receive ACK
Send nothing
Receive ACK
Send nothing
LAST_ACK
Send FIN
ESTABLISHED
CLOSED
LISTEN
Receive SYN
Send SYN/ACK
CLOSE_WAIT
SYN_RCVD
Send FIN
FIN_WAIT_1
Client application
Initiates close connection
Receive FIN
Send ACK
ESTABLISHED
Receive ACK
Send nothing
21
Network application models
•  Client/Server
•  Peer-to-peer
•  Hybrid
22
Client server model
•  Client
•  Request services from
client
client
client
client
Server
Server
•  Clients do not contact
directly each other
•  Server
•  “Always” online waitng for
requests from Clients
•  Ex: Web, Mail, …
Client/sever model
•  Client asks (request) – server provides (response)
•  Typically: single server - multiple clients
•  The server does not need to know anything about the
client
•  even that it exists
•  The client should always know something about the
server
•  at least where it is located
1. Client sends request
4. Client
handles
response
Client
process
Server
process
3. Server sends response
Resource
2. Server
handles
request
Note: clients and servers are processes running on hosts
(can be the same or different hosts).
24
Pure Peer to Peer
Peer
•  No central server
Peer
•  Peers have equal role
•  Peers can communicate
Peer
Peer
Peer
Peer
directly to each other
•  Peers do not need to be
always online
•  E.g. Gnutella, Emule
25
Hybrid model
•  Central server manages
Client
user accounts,
authentification, stores
data for searching process
…
•  Clients communicate
directly after
authentication process.
•  E.g. Skype
Server
•  Server manages login
Client
Client
P2P Comm.
Client-Server Comm.
process.
•  Messages, voices are
transmitted directly between
servers.
Sockets as means for inter-process
communication (IPC)
application layer
application layer
Client Process
Internet
Socket
transport
layer (TCP/UDP)
OS network
network layer (IP)
stack
link layer (e.g. ethernet)
physical layer
Server Process
Socket
Internet
Internet
transport layer (TCP/UDP)
OS network
network layer (IP)
stack
link layer (e.g. ethernet)
physical layer
The interface that the OS provides to its networking
subsystem
Internet Connections (TCP/IP)
•  Address the machine on the network
•  By IP address
•  Address the process/application
•  By the “port”-number
•  The pair of IP-address + port – makes up a “socket-address”
Client socket address
128.2.194.242:3479
Client
Server socket address
208.216.181.15:80
Connection socket pair
(128.2.194.242:3479, 208.216.181.15:80)
Client host address
128.2.194.242
Note: 3479 is an
ephemeral port allocated
by the kernel
Server
(port 80)
Server host address
208.216.181.15
Note: 80 is a well-known port
associated with Web servers
Internet Connections (TCP/IP)
•  Need to open two sockets of both sides
•  Client socket
•  Server socket
•  Client application send/receive data to server through
client socket
•  Server application send/receive data to client through
client socket
•  Make two sockets talk to each other.