27
Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

Networking and Internetworking:Standards and Protocols

i206 Fall 2010

John Chuang

Some slides adapted from Coulouris, Dollimore and Kindberg

Page 2: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 2

Formal Definition of the Internet Resolution passed by the Federal Networking Council October 24, 1995

"Internet" refers to the global information system that -- - (i) is logically linked together by a globally unique address space based on the Internet Protocol (IP) or its subsequent extensions/follow-ons;

- (ii) is able to support communications using the Transmission Control Protocol/Internet Protocol (TCP/IP) suite or its subsequent extensions/follow-ons, and/or other IP-compatible protocols; and

- (iii) provides, uses or makes accessible, either publicly or privately, high level services layered on the communications and related infrastructure described herein.

Page 3: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 3

Outline

Last time: Network architecture- Layering and encapsulation

Today: Study specific protocols- Internet Protocol (IP)- Transmission Control Protocol (TCP)- User Datagram Protocol (UDP)

HTTP message

TCP header

IP header

Ethernet header

Ethernet frame

port

TCP

IP IP datagram/packet

TCP segment

HTTP message

Adapted from Coulouris, Dollimore and Kindberg

Page 4: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 4

Internetworking Standards

Internetworking standards set by IETF (Internet Engineering Task Force)

Documented as RFCs (Requests for Comment):- RFC 791: IP- RFC 793: TCP- RFC 2460: IPv6- RFC 1034, 1035: DNS

http://www.ietf.org/rfc.html

Page 5: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 5

Network LayerAppl

Transport

Network

Link

Network

Link

Network

Link

Appl

Transport

Network

Link

Host A Host BRouter 1 Router 2

end-to-end

point-to-point

point-to-point

end-to-end

Page 6: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 6

Internet Protocol (IP)

Two main functions of network layer:- Addressing- Packet switching (routing + packet forwarding)

Allow packets to traverse multiple networks Deliver packet to specified destination host Best effort: network delivers packets as reliably and as quickly as it can (but provides no guarantee of delivery)- Routers can and often do drop packets as part of normal operations

Page 7: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 7

IP Packet Format (v4)

Total Length in bytes (16)

Time to Live (8)

Options (if any)

Bit 0 Bit 31

Version(4)

Hdr Len(4) TOS (8)

Identification (16 bits) Flags (3) Fragment Offset (13)

Source IP Address (32)

Destination IP Address (32)

Header Checksum (16)Protocol (8)

Data (variable length)

Header

Dat

a

Field length in bits

Page 8: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 8

IP Address

Every networked host is identified by its IP address

IP (version 4) addresses are 32 bits long- 232 = 4,294,967,296 unique IP addresses

IPv6 addresses are 128 bits long- 2128 = 340,282,366,920,938,463,463,374,607,431,768,211,455 unique IP addresses

Page 9: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 9

IP Address: Dotted Decimal Notation

Hostname: ischool.berkeley.edu IP address: 128.32.226.87

128 32 226 87

0 16 318 24

1 0 0 0 0 0 0 00 0 1 0 0 0 0 01 1 1 0 0 0 1 00 1 0 1 0 1 1 1

Domain Name Service (DNS) performs translation

Page 10: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 10

Packet Switching (Routing)

Host A Host B

128.32.226.8712.2.14.60

Page 11: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 11

Two Basic Functions in Packet Switching

Routing- Learn the best route to (or best next-hop for) any given destination- Routers exchange local link status or destination reachability information

- Compute best path to destinations• Algorithms for computing shortest paths (e.g., Dijkstra’s)

• Policies that reflect business agreements (use BGP)

- Update the routing table Packet forwarding

- For each packet received on an incoming link, forward it to an outgoing link according to the routing table

Page 12: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 12

Control Plane

DestinationAddress

OutgoingLink

Outgoing links

Routing table

Packet

Packet Switch in Action

Cw.x.y.z

Incoming links

Data Plane

Control plane of a router communicates with its counterparts at other routers using routing protocols (e.g., RIP, OSPF, BGP)

Page 13: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 13

Transport LayerAppl

Transport

Network

Link

Network

Link

Network

Link

Appl

Transport

Network

Link

Host A Host BRouter 1 Router 2

end-to-end

point-to-point

point-to-point

end-to-end

Page 14: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 14

Transmission Control Protocol (TCP)

End-to-End reliable data transport

Addressing (using ports)

Page 15: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 15

TCP Segment Format

Bit 0 Bit 31

Data (variable length)

Header

Dat

a

Source Port # (16) Destination Port # (16)

Sequence Number (32 bits)

Acknowledgement Number (32 bits)

Hdr Len(4) Flags (6) Window Size (16)

Options (if any) Padding

Reserved (6)

TCP Checksum (16) Urgent Pointer (16)

Page 16: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 16

TCP Ports

TCP port number designates communicating processes on a single host

Source Port # (16) Destination Port # (16)

Sequence Number (32 bits)

Acknowledgement Number (32 bits)

Hdr Len(4) Flags (6) Window Size (16)

Options (if any) Padding

Bit 0 Bit 31

Reserved (6)

TCP Checksum (16) Urgent Pointer (16)

message

agreed portany port socketsocket

Internet address = 138.37.88.249Internet address = 138.37.94.248

other ports

client server

Source: Coulouris, Dollimore and Kindberg

Page 17: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 17

Ports

The port numbers are divided into three ranges: - Well known ports (0-1023)- Registered ports (1024-49151)- Dynamic and/or private ports (49152 – 65535)

Some “well known ports”- ftp (21); ssh (22); telnet (23); smtp (25); finger (79); http (80)

- assigned by Internet Assigned Numbers Authority (www.iana.org/numbers.html)

Page 18: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 18

Reliable Delivery?Process A Process B

time

Data

Data

Data Packet Loss

Q: how to support reliable data transfer when underlying network is unreliable?

Page 19: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 19

Reliable Delivery

Positive acknowledgment with retransmission Sequence and acknowledgement numbers

Options (if any)

0 3116

Padding

Data

TCP Header

Source Port Number (16) Destination Port Number (16)

Sequence Number (32)

Acknowledgement Number (32)

Hdr Len(4)

Flags (6) Window Size (16)Reserved (6)

TCP Checksum (16) Urgent Pointer (16)

Page 20: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 20

Reliable Delivery

Each packet has a sequence number (SEQ)- SEQ represents byte offset with respect to initial SEQ- Duplicate packets can be detected and discarded- Out of order packets can be re-ordered

Each packet carries acknowledgment of received packet- ACK = sequence number of next byte expected by the receiver

Lost packet can be detected by missing ACK

Lost packet can be retransmitted after a timeout period

Page 21: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 21

ACK and Packet Retransmission

Process A Process B

time

Data (Seq=x+1)

Data (Ack=x+2)

Data (Ack=x+3)

Data (Seq=x+2)T

imeo

ut

Data (Seq=x+2)

IP loses packet

TCP resends packet

Page 22: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 22

ACK and Packet Retransmission

Process A Process B

time

Data (Seq=x+1)

Data (Ack=x+2)

Data (Ack=x+3)

Data (Seq=x+2)T

imeo

ut

Data (Seq=x+2)

IP loses ACK

TCP resends packet

TCP resends ACK;drops duplicate

Data (Ack=x+3)

Page 23: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 23

User Datagram Protocol Port numbers for addressing No mechanism for reliable data transfer Light-weight:

- low overhead; no connection setup- used for real-time applications (don’t need retransmission)

- non-standard protocols can be implemented on top of UDP

0 3116

Data

UDP Header

Source Port Number (16) Destination Port Number (16)

UDP Checksum (16)Message Length (16)

Page 24: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 24

Application LayerAppl

Transport

Network

Link

Network

Link

Network

Link

Appl

Transport

Network

Link

Host A Host BRouter 1 Router 2

end-to-end

point-to-point

point-to-point

end-to-end

Page 25: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 25

Hyper Text Transfer Protocol (HTTP)

Request line GET /index.html HTTP/1.1<CRLF>

Host: www.ischool.berkeley.edu <CRLF>

<CRLF>Blank line

Request header

HTTP message

TCP header

IP header

Ethernet header

Ethernet frame

port

TCP

IP IP datagram/packet

TCP segment

HTTP message

Adapted from Coulouris, Dollimore and Kindberg

Page 26: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 26

Real-Time Transport Protocol (RTP)

Protocol for transport of real-time multi-media data- Sequence number and timestamp in RTP header

- RTP messages encapsulated in UDP datagrams

Source: Douglas Comer

Page 27: Networking and Internetworking: Standards and Protocols i206 Fall 2010 John Chuang Some slides adapted from Coulouris, Dollimore and Kindberg

John Chuang IS206 UC Berkeley 27

Domain Name Service (DNS)

Routers and end-hosts use IP addresses - e.g., 128.32.226.87

Human beings remember hostnames - e.g., ischool.berkeley.edu

Need translation service!

Client sends DNS query message (hostname) to domain name server using UDP

Name server sends DNS response message (with resolved IP address) back to client