Introduction to Network Computing Bill Chu
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 1/52
Introduction to NetworkComputing
Bill Chu
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 2/52
The World-Wide-Web
revolution Virtually all the general purpose computers are connected in the
past five years.
Killer applications Visical World Wide Web
E-commerce / On-line trading
Napster
E-Business
The Internet has changed the way we Understand computing
Use/write applications
Deliver application
Maintain applications
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 3/52
Sample network-based
applications Hotmail
Yahoo
Amazon.com
Tax return
Games
E-bay
Cracking of DES
The network hasbecome the
computer
storage
library
market
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 4/52
Introduction to computercommunication networks
Bei-Tseng (Bill) Chu
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 5/52
Protocol
A protocol is a series of steps, involving two or moreparties, designed to accomplish a task
Everyone involved in the protocol must know the
protocol and all of the steps to follow in advance Everyone in the protocol must agree to follow it
The protocol must be unambiguous; each step must be well defined and there must be no chance of amisunderstanding.
The protocol must be complete; there must be aspecified action for every possible situation.
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 6/52
CommunicationProtocol Model
A template to describe a protocol
It has three components Address: naming
Format: messages
Behavior: rulesProtocol Model
Address:
- how to name a partner
Format:
- specify the message formats
Rules:
- specify the behaviors of the
protocol
- what should be done when
something happens
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 7/52
Address:phone number xxx-xxxx
Format:
English
Rules:
- dial when initiating
- pick up phone when
ringing
- ...
Phone conversation Protocol
Protocol Example: PhoneProtocol Example: Phone
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 8/52
Can a single protocol do it all?
Computer communication has to deal all sorts of problems Electrical/Optical signals/noise
Errror detection and recovery
medium control access
message boundary
routing, fragmentation
flow control (net congestion)
loss and duplicated messages
synchronization
representation
application specific
Yes. It can be done but how to develop in timely fashion (debug, verify and low cost)
how to maintain it
how to extend and evolve it
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 9/52
Layered Approach
Divide and conquer
partition into multiple layers of software
each layer has clear programming interfaces each interface provides a service to adjacent layers
each layer solves a limited set of problems
each layer encapsulates the related details
Pros
reduce complexity, isolate changes, promote manageability
Cons
efficiency
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 10/52
ISOReference Model
Not every layer is created equal physical and data link are hardware heavy
network and transport are software heavy
session and presentation are typically light layers
Some functions occurs in
multiple layers:+ Error handling may be in
every layer
+ Flow control can be in
multiple layers
Layer Number Layer Name Problems to Be Solved
7 Application layer application specific (Lab #2)
6 Presentation layer data representation (XDR)
5 Session layer synchronization & dialog (client/server)4 Transport layer reliable delivery of messages (sockets)
3 Network layer routing & fragmentation
2 Data link layer medium access control & framing
1 Physical layer signaling, physical connections
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 11/52
ISO vs. TCP /IP
1. Physical
2.Data Link
3.Network
4.Transport
5.Session
6.Presentation
7.Application
Host tonetwork
Internet
Transport
Application
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 12/52
Physical layer protocols
Highly physical network technology dependent
Main tasks
define the signaling protocol what is the meaning of 1s or 0s
voltages or frequencies
what is bad signals
define the physical connections required
RS232 connectors for RS232 serial line communication
RJ45 or BNC connectors for Ethernet define the communication media
define the network topology
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 13/52
Physical Network Technologies Circuit-switched network (CS)
connection-oriented network
establish connection before communication
once communication established, a circuit line is reserved forthe communicating partners
example: telephone network
Packet-switched network (PS)
store-forward based network packet sent from a node to another node
the intermediate node stores the packet and decides to forwardto another node towards the destination
no circuit line is reserved
example: Ethernet
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 14/52
Circuit connection
in out
In Out
3 2
4 1
Routing table
In Out
2 4
Routing table
In Out
2 4
Routing table
In Out
2 2
3 4
Routing table
Host A
Host B
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 15/52
Comparisons: CS
andPS
Circuit-switched Packet-switched
line resource dedicated shared
performance guaranteed averaged
cost expensive less
adaptive routing not easy easy
switch device highly complex simple
reliability high higher
utilization low higher
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 16/52
NetworkTypes by
Scope
WAN
wide area network
cross large span of space (continental)
typically heterogeneous and low speed example: Internet
MAN
metro-area network
regional scope (city-wide)
L AN
local area network
limited scope (a couple of buildings)
typically homogeneous & high speed
example: Ethernet & Token ring
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 17/52
Network Transmission
Medium Open air
radio, microwaves, satellites, infrared
noise signals, collision
Optical clear signals, low power and high rate (Gbps)
Copper wire
Lower cost interfaces
Bi-directional
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 18/52
Bus Network Topology
Every nodes tap into a common medium
Signals may collide with each other
need to arbitrate who will get the bus
capable of broadcasting message (one send & many listen)
the common medium is the bottleneck
single node failure causes no network failure
the medium failure brings down the network
Example: (old, 10BASE2, 10BASE5) Ethernet
common medium
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 19/52
Cable Modem
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 20/52
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 21/52
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 22/52
Mash Network Topology Nodes are arranged in grids
each node can talk to its neighbors directly
non-neighbor nodes needs store-and-forward for communication
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 23/52
Hyper Network Topology No restrictions on how to link the nodes
Topology can adapt to individual organization needs
Master
slave
slave
slave
slave slave
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 24/52
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 25/52
Introduction to Internet andTCP /IP
Bei-Tseng (Bill) Chu
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 26/52
Motivations for Internet
Observations:
Different physical networks everywhere
connection between limited hosts
different needs for different technologies legacy networks
Limited connectivity
each physical technology has its limits
Different technologies use different languages
Need for a uniform virtual network universal connectivity
every host speaks the same language independent of physicalnetworks
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 27/52
Virtual Network over Physical Networks
«...Ethernet Token Ring ATM
Internet Protocol (Network layer)
Internet
Virtual network
Physical network
hosts
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 28/52
Design Goals of Internet A virtual (global) network
independent of physical technologies
independent of locations
universal language
Universal connectivity every host is equal no matter of
its architecture and system origin
its physical network attachment
Scalable growth without limits
Robust no single point of failure
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 29/52
Problems to be
Solved
Universal naming how to translate the universal name to local name used
by local physical network?
Routing how to route IP packages among different local networks
to reach the destination?
Fragmentation different physical networks use different package sizes.
how this should be handled?
Error handling
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 30/52
Internet Architecture
Internet: the mother of all networks
THE network of (interconnected) networks
Physical networks interconnected via gateways
Gateway(router) is a host glues nets together
attached to multiple nets
forward IP packages between nets
Token Ring
Gateway
Ethernet
Other nets Gateway
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 31/52
IP Packet Format
IP packet consists of header and data portions
IP header IP data portion
V HL type total length
Identification F frag. offset
TTL prot header cksum
Source IP address
Destination IP address
options if any
IP Header Format
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 32/52
IP
Address IP address specifies a connection to a network instead of a host
IP address == NetID + HostID
Dotted notation
each byte in an IP address represented as a decimal
bytes are separated with a period (.)
example: 152.15.35.44
Classes0 8 16 24 31
0NetID HostID
10 NetID HostID
110 NetID HostID
1110 Multicast address
11110 reserved for future use
class Aclass B
class C
class D
class E
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 33/52
How do computers talk to each
other on an ethernet bus
Each computer on the internet as a unique IP address.
Each network interface (e.g. ethernet card) has a unique address
8.2.1.1 wants to send a message 8.2.1.3
It yells yaahoo, who is 8.1.2.3 Each computer listens to messages on the bus (collision detection and
resolution) for yaahoo
8.2.1.3 replies to 00550DA2F5D82 I am 02950JX2F5Y82
8.2.1.1 sends the message to 8.2.1.3.
8.2.1.1 8.2.1.2 8.2.1.3
00550DA2F5D8202550JA2F5D82
02950JX2F5Y82
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 34/52
IP
Routing Principles
Route packages according to their destination IP net ID
Forward packages hop by hop
each gateway has the routing knowledge of its nearby neighbors
hosts route packages to gateway and gateway does the rest.
Routing types
direct routing
If the destination net ID is the same as the local net ID, no routing togateway is needed and send the package via underlying physical
network indirect routing
if the destination net ID is different from the local net ID, send thepackage to an appropriate gateway.
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 35/52
IP
Rules Fragmentation rules
if underlying net size < packet size & not final dest
break packet into small packets and send them
if final dest is reached & packets are fragmented
reassemble fragmental packets into original size
Error rules
if IP header is erroneous, drop/report it
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 36/52
Table-Driven I
PRouting
Each IP host has a IP routing table
each entry associates a destination net ID with a forwardinggateway
each route has a performance metrics
number of hops to reach the destination
Route table for 152.15.36.9
152.15.x.xuncc
ncsu
152.15.254.254
163.29.x.x
163.29.10.88
152.15.36.9
152.15.35.1
net3
e0
Dest. Net ID Next hop host NIF
163.29 152.15.254.254
e0
Default 152.15.35.1 e0
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 37/52
Routes in an IP
RoutingT
able Next-hop routes
the destination is an IP net ID: a packages addressed toany host in the net, send to the associated gateway
Host-specific routines the destination is a complete IP address: route all packages
to the specified host via the associated gateway
Default routes
the catch all routing: all packages not specified by theabove, send the gateway associated with the default route.
the gateway associated with the default route is calleddefault gateway
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 38/52
Topology of the internet
net: 9.1.1.x
net: 8.2.1.x
9.1.1.3
net 1.1.1.x
net 2.1.1.x
net 3.1.1.x
9.1.1.2
9.1.1.4
9.1.1.18.2.1.1
8.2.1.2 8.2.1.3
8.2.1.4
d
cb
a
1 2 34
hardware addresses
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 39/52
Sub-netting
All hosts in a network must have thesame net work number
As the number of networks grow, sodoes the need for net work numbers
Solution: subnet, divide the host nameportion of the IP address into subnet idand the host
Subnet mask and routing table.
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 40/52
Intranet example: home
networking
Router
PC
PC
PC
BroadbandproviderInternet
Internet IP Address
Intranet IP address
Intranet IP address
Intranet IP address
Intranet IP address
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 41/52
PPPprotocol (phone dialin)
Computer (client) dials to a modem.
Computer on the other (ISP server) endis on the internet.
The ISP server assigns an ip address forthe dialing computer
All messages send from the client arerouted by the isp host to the rest of theinternet.
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 42/52
DHCP protocol (most ethernet)
Client sends a message (on the localbus) to a DHCP server requesting an IP
address for the session
DHCP server assigns an ip address
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 43/52
IP
Fragmentation IP packages are broken to fit underlying physical
network when a package is sent
locations of fragmentation
original package sender
gateways that forward the package
IP packages are reassembled at the final destination
gateway
fragment
net 1 net 2
assemble
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 44/52
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 45/52
ISO vs. TCP /IP
1. Physical
2.Data Link
3.Network
4.Transport
5.Session
6.Presentation
7.Application
Host tonetwork
Internet
Transport
Application
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 46/52
T
ransport L
ayer Why do we need a transport layer?
Network layer provides delivery only
from a host to a host
in a best effort fashion
Users want to transport data
from application to application
in a reliable delivery
Transport layer fits the gap between user needs andIP messaging
provide communication endpoint for applications
deliver messages reliably
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 47/52
Problems to Be Solved in Transportation layer
Missing packets
Duplicated packets
Out of order packets
Flow control
Synchronization
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 48/52
Reliable Delivery via Unreliable
Networks Missing packet
acknowledge and timeout
retransmission
Duplicate messages sequencing packets
Out of order messages sequencing packets
Flow control
wait and stop window-sliding
Synchronization hand shaking
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 49/52
T
ransport P
rotocols inT
CP
/IP
User Datagram Protocol (UDP)
provide communication endpoint for applications
best effort delivery of messages (packets)
message boundary is observed
the protocol embedded in Internet Datagram sockets
Transmission Control Protocol (TCP) provide communication endpoint for applications
reliable delivery via connection-based communication no message boundary between packages
the protocol embedded in Internet Stream sockets
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 50/52
Establish aT
CP
Connection Three way handshaking
application 1 application 2
TCPpack p;
p.codebit=SYN;
p.seq_no = x; p.winsize=S1;
send (p);
tcp_state=SYNSENT;
receive(p);
p.ack = p.seq_no + 1;
p.seq_no = x++;
send(p);
tcp_state=ESTABLISHED
syn+x
TCPpack pack;tcp_state=LISEN;
receive(pack);
pack .ack=pack .seq_no+1
pack .seq_no = y; pack .winsize=S2;
send(pack);
tcp_state=ESTABLISHED;
syn+ack+y
ack
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 51/52
Denial of service attacks Exploits the TCP session establishment
protocol.
An attacker will send syn, but neversends ack. This type of attack is alsocalled sync flood.
Synchronized attacks launched onmultiple (often victim) machines.
8/6/2019 Introduction to Computer Communication
http://slidepdf.com/reader/full/introduction-to-computer-communication 52/52
T
CP
Retransmission Sender
is free to divide user stream data in packets
expects an ack for each packet sent
starts a timer when a packet is sent upon an ack reception, advances seq_no expected
upon a timer expiration, resends the packet
Receiver sends an ack whenever a packet is received
deletes the packet if it duplicated is free to pass acknowledged packets to user
is forced to pass to user the data when receives a PUSH