29
Lect ure Recap: “O perational ” view of Internet Internet: “network of networks” Requires sending, receiving of messages protocols control sending, receiving of messages e.g., TCP, IP, HTTP, Skype, Ethernet etc. Design of protocols is the key for Internet Home network Institutional network Mobile network Global ISP Regional ISP 1-1

Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Embed Size (px)

Citation preview

Page 1: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Lecture 1

Recap: “Operational” view of Internet Internet: “network of

networks” Requires sending,

receiving of messages

protocols control sending, receiving of messages e.g., TCP, IP, HTTP, Skype,

Ethernet etc.

Design of protocols is the key for Internet

Home network

Institutional network

Mobile network

Global ISP

Regional ISP

1-1

Page 2: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

application support host/network applications Email, FTP, HTTP (HTML)

transport process-process data transfer TCP, UDP

network routing of datagrams from src. to destn. IP address, routing protocols

link data transfer between neighboring network

elements Ethernet, PPP

physical bits “on the wire”

1-2

Internet protocol stack

application

transport

network

link

physical

Lecture 3

Page 3: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Network Layer 4-3

Network layer

Network layer protocols in every host, router

Router examines header fields in all IP datagrams passing through it

application

transportnetworkdata linkphysical

application

transportnetworkdata linkphysical

networkdata linkphysical network

data linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysicalnetwork

data linkphysical

Page 4: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Network Layer 4-4

Key Network-Layer Functions

Forwarding: move packets from router’s input to appropriate router output

Routing: determine route taken by packets from source to dest.

analogy:

forwarding: process of getting through single interchange

routing: process of planning trip from source to dest

Page 5: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Network Layer 4-5

Key Network-Layer Function

requirement:

Need to know the addresses Zip codes ~ e.g., 10019

What is the address for computers / routers?

Page 6: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

IP Address

Network Layer 4-6

Page 7: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

7

IP Address

An IP address is a 32-bit sequence of 1s and 0s. To make the IP address easier to use, the address is

usually written as four decimal numbers separated by periods.

This way of writing the address is called the dotted decimal format.

11011111 00000001 00000001 00000001

223 1 11

Page 8: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Network Layer 4-8

IP Addressing example network IP address: 32-bit

identifier for host, router interface

interface: connection between host/router and physical link router’s typically have

multiple interfaces host typically has one

interface IP addresses

associated with each interface

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 11

Page 9: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

9

A quick look at Binary and Decimal Number format

Page 10: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Decimal (base 10)

Uses positional representation Each digit corresponds to a power of 10

based on its position in the number The powers of 10 increment from 0, 1,

2, etc. as you move right to left

1,234 = 1 * 103 + 2 * 102 + 3 * 101 + 4 * 100

Page 11: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Binary (base 2) Two digits: 0, 1 To make the binary numbers more

readable, the digits are often put in groups of 4 or 8

1010 = 1 * 23 + 0 * 22 + 1 * 21 + 0 * 20

= 8 + 2 = 10

1100 1001 = 1 * 27 + 1 * 26 + 1 * 23 + 1 * 20

= 128 + 64 + 8 + 1 = 201

Page 12: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Conversion From binary to decimal

Use positional representation as shown in last slide

From decimal to binary (tricky!) Keep dividing by 2 Remainders give the digits, starting from

lowest power

Let’s look at some examples… Now we are ready for IP addressing

Page 13: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

IP address Class Handouts…

(provided in class)

Network Layer 4-13

Page 14: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Every IP address has two parts: 1. Network part2. Host part

IP addresses are divided into classes A,B and C to define -- large, -- medium, and -- small networks.

The Class D address class was created to enable multicasting.

Class E addresses reserved for future and research.

IP Address

Page 15: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

IP Address classes

Page 16: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Some special IP addresses

Network Layer 4-16

Page 17: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Network Layer 4-17

DHCP: Dynamic Host Configuration Protocol

Goal: allow host to dynamically obtain its IP address from network server when it joins networkCan renew its lease on address in useAllows reuse of addresses (only hold address while connected an “on”)Support for mobile users who want to join network (more shortly)

DHCP overview: host broadcasts “DHCP discover” msg [optional] DHCP server responds with “DHCP offer” msg [optional] host requests IP address: “DHCP request” msg DHCP server sends address: “DHCP ack” msg

Page 18: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Network Layer 4-18

DHCP client-server scenario

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

A

BE

DHCP server

arriving DHCP client needsaddress in thisnetwork

Page 19: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Network Layer 4-19

DHCP client-server scenarioDHCP server: 223.1.2.5 arriving

client

time

DHCP discover

src : 0.0.0.0, 68 dest.: 255.255.255.255,67yiaddr: 0.0.0.0transaction ID: 654

DHCP offer

src: 223.1.2.5, 67 dest: 255.255.255.255, 68yiaddrr: 223.1.2.4transaction ID: 654Lifetime: 3600 secs

DHCP request

src: 0.0.0.0, 68 dest:: 255.255.255.255, 67yiaddrr: 223.1.2.4transaction ID: 655Lifetime: 3600 secs

DHCP ACK

src: 223.1.2.5, 67 dest: 255.255.255.255, 68yiaddrr: 223.1.2.4transaction ID: 655Lifetime: 3600 secs IP: 223.1.2.4

Page 20: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Numerical example

A software company has 100 employees. What would be the ideal class from which the company would

choose its network IP to prevent wastage of IP addresses? How many bits would be assigned for network part and how many bits would be assigned for host part?

The company suddenly goes through increase in number of employees from 100 to 2040.

What would be the ideal class from which the company would choose its network IP to prevent wastage of IP addresses?

How many bits would be assigned for network part and how many bits would be assigned for host part?

Solve!

Network Layer 4-20

Page 21: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Network Layer 4-21

IP addressing: CIDR

CIDR: Classless InterDomain Routing subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in

subnet portion of address

Back to the previous numerical example? How many address wastage?

11001000 00010111 00010000 00000000

subnetpart

hostpart

200.23.16.0/21

Page 22: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Network Address Translation (NAT)

Network Layer 4-22

Page 23: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

Home network

local network(e.g., home network)

rest ofInternet

Page 24: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

NAT: Network Address Translation

10.0.0.1

10.0.0.2

10.0.0.3

10.0.0.4

138.76.29.7

local network(e.g., home network)

10.0.0/24

rest ofInternet

Datagrams with source or destination in this networkhave 10.0.0/24 address for

source, destination (as usual)

All datagrams leaving localnetwork have same single source

NAT IP address: 138.76.29.7,different source port numbers

Page 25: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

NAT: Network Address Translation

Advantages:

local network uses just one IP address as far as outside world is concerned: min. IP address wastage

can change addresses of devices in local network without notifying outside world: flexibility

devices inside local net not explicitly addressable, visible by outside world (a security plus).

Page 26: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

NAT: Network Address Translation

10.0.0.1

10.0.0.2

10.0.0.3

S: 10.0.0.1, 3345D: 128.119.40.186, 80

1

10.0.0.4

138.76.29.7

1: host 10.0.0.1 sends datagram to 128.119.40.186, 80

NAT translation tableWAN side addr LAN side addr

138.76.29.7, 5001 10.0.0.1, 3345…… ……

S: 128.119.40.186, 80 D: 10.0.0.1, 3345

4

S: 138.76.29.7, 5001D: 128.119.40.186, 80

2

2: NAT routerchanges datagramsource addr from10.0.0.1, 3345 to138.76.29.7, 5001,updates table

S: 128.119.40.186, 80 D: 138.76.29.7, 5001

3

3: Reply arrives dest. address: 138.76.29.7, 5001

4: NAT routerchanges datagramdest addr from138.76.29.7, 5001 to 10.0.0.1, 3345

Page 27: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

NAT: Network Address Translation

16-bit port-number field: 60,000 simultaneous connections with a

single LAN-side address!

Page 28: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

NAT traversal problem client wants to connect to

server with address 10.0.0.1 server address 10.0.0.1

local to LAN (client can’t use it as destination addr)

only one externally visible NATted address: 138.76.29.7

solution 1: statically configure NAT to forward incoming connection requests at given port to server

10.0.0.1

10.0.0.4

NAT router

138.76.29.7

Client?

Page 29: Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,

NAT traversal problem solution 2: relaying (used in Skype)

NATed client establishes connection to relay

External client connects to relay relay bridges packets between connections

138.76.29.7

Client

10.0.0.1

NAT router

1. connection torelay initiatedby NATted host

2. connection torelay initiatedby client

3. relaying established