52
Introduction to Network Computing Bill Chu

Introduction to Computer Communication

Embed Size (px)

Citation preview

Page 1: Introduction to Computer Communication

8/6/2019 Introduction to Computer Communication

http://slidepdf.com/reader/full/introduction-to-computer-communication 1/52

Introduction to NetworkComputing

Bill Chu

Page 2: Introduction to Computer Communication

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

Email

E-commerce / On-line trading

Napster

E-Business

The Internet has changed the way we Understand computing

Use/write applications

Deliver application

Maintain applications

Page 3: Introduction to Computer Communication

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 

Page 4: Introduction to Computer Communication

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

Page 5: Introduction to Computer Communication

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.

Page 6: Introduction to Computer Communication

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

Page 7: Introduction to Computer Communication

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

Page 8: Introduction to Computer Communication

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 

Page 9: Introduction to Computer Communication

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

Page 10: Introduction to Computer Communication

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

Page 11: Introduction to Computer Communication

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

Page 12: Introduction to Computer Communication

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

Page 13: Introduction to Computer Communication

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 

Page 14: Introduction to Computer Communication

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

Page 15: Introduction to Computer Communication

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

Page 16: Introduction to Computer Communication

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

Page 17: Introduction to Computer Communication

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

Page 18: Introduction to Computer Communication

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

Page 19: Introduction to Computer Communication

8/6/2019 Introduction to Computer Communication

http://slidepdf.com/reader/full/introduction-to-computer-communication 19/52

Cable Modem

Page 20: Introduction to Computer Communication

8/6/2019 Introduction to Computer Communication

http://slidepdf.com/reader/full/introduction-to-computer-communication 20/52

Page 21: Introduction to Computer Communication

8/6/2019 Introduction to Computer Communication

http://slidepdf.com/reader/full/introduction-to-computer-communication 21/52

Page 22: Introduction to Computer Communication

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

Page 23: Introduction to Computer 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

Page 24: Introduction to Computer Communication

8/6/2019 Introduction to Computer Communication

http://slidepdf.com/reader/full/introduction-to-computer-communication 24/52

Page 25: Introduction to Computer Communication

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

Page 26: Introduction to Computer Communication

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

Page 27: Introduction to Computer Communication

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

Page 28: Introduction to Computer Communication

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

Page 29: Introduction to Computer Communication

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

Page 30: Introduction to Computer Communication

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

Page 31: Introduction to Computer Communication

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

Page 32: Introduction to Computer Communication

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

Page 33: Introduction to Computer Communication

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

Page 34: Introduction to Computer Communication

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.

Page 35: Introduction to Computer Communication

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 

Page 36: Introduction to Computer Communication

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

Page 37: Introduction to Computer Communication

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

Page 38: Introduction to Computer Communication

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

Page 39: Introduction to Computer Communication

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.

Page 40: Introduction to Computer Communication

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

Page 41: Introduction to Computer Communication

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.

Page 42: Introduction to Computer Communication

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

Page 43: Introduction to Computer Communication

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

Page 44: Introduction to Computer Communication

8/6/2019 Introduction to Computer Communication

http://slidepdf.com/reader/full/introduction-to-computer-communication 44/52

Page 45: Introduction to Computer Communication

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

Page 46: Introduction to Computer Communication

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

Page 47: Introduction to Computer Communication

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

Page 48: Introduction to Computer Communication

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

Page 49: Introduction to Computer Communication

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

Page 50: Introduction to Computer Communication

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 

Page 51: Introduction to Computer Communication

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.

Page 52: Introduction to Computer Communication

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