Dongsoo S. Kim Electrical and Computer Engineering Indiana U. Purdue U. Indianapolis

Similar documents
IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

Vorlesung Kommunikationsnetze

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

ROUTING INTRODUCTION TO IP, IP ROUTING PROTOCOLS AND PROXY ARP

IP Protocols. ALTTC/Oct

ECE4110 Internetwork Programming. Introduction and Overview

EEC-684/584 Computer Networks

Introduction to routing in the Internet

II. Principles of Computer Communications Network and Transport Layer

The Interconnection Structure of. The Internet. EECC694 - Shaaban

Introduction to routing in the Internet

CHAPTER-2 IP CONCEPTS

EITF25 Internet Techniques and Applications L7: Internet. Stefan Höst

Outline. Routing. Introduction to Wide Area Routing. Classification of Routing Algorithms. Introduction. Broadcasting and Multicasting

CS 356: Computer Network Architectures. Lecture 10: IP Fragmentation, ARP, and ICMP. Xiaowei Yang

TCP /IP Fundamentals Mr. Cantu

Topics for This Week

TSIN02 - Internetworking

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

Basic Idea. Routing. Example. Routing by the Network

Routing by the Network

Chapter 8 Communication Networks and Services

Networking Technologies and Applications

User Datagram Protocol

The Network Layer. Internet solutions. Nixu Oy PL 21. (Mäkelänkatu 91) Helsinki, Finland. tel fax.

Data Communication Prof. A. Pal Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 34 TCP/ IP I

EC441 Fall 2018 Introduction to Computer Networking Chapter4: Network Layer Data Plane

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

Outline. IP Address. IP Address. The Internet Protocol. o Hostname & IP Address. o The Address

HY 335 Φροντιστήριο 8 ο

Computer Networks ICS 651. IP Routing RIP OSPF BGP MPLS Internet Control Message Protocol IP Path MTU Discovery

EE 610 Part 2: Encapsulation and network utilities

Department of Computer and IT Engineering University of Kurdistan. Network Layer. By: Dr. Alireza Abdollahpouri

Master Course Computer Networks IN2097

Network Layer. The Network Layer. Contents Connection-Oriented and Connectionless Service. Recall:

Network Layer. Recall: The network layer is responsible for the routing of packets The network layer is responsible for congestion control

Internet Protocols (chapter 18)

IPv4. Christian Grothoff.

Internetworking Part 2

internet technologies and standards

Guide to Networking Essentials, 6 th Edition. Chapter 5: Network Protocols

Network layer: Overview. Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing

Part 4. Wide Area Networks (WAN)

K2289: Using advanced tcpdump filters

Network layer: Overview. Network Layer Functions

Chapter 12 Network Protocols

TSIN02 - Internetworking

Network Layer: Internet Protocol

Internetworking/Internetteknik, Examination 2G1305 Date: August 18 th 2004 at 9:00 13:00 SOLUTIONS

TCPIP Protocol Suite & Utilities. Revision no.: PPT/2K403/02

Chapter 09 Network Protocols

Last time. Network layer. Introduction. Virtual circuit vs. datagram details. IP: the Internet Protocol. forwarding vs. routing

EEC-484/584 Computer Networks

CSCI-1680 Network Layer: IP & Forwarding John Jannotti

SEN366 (SEN374) (Introduction to) Computer Networks

Router Architecture Overview

TCP/IP Protocol Suite

Top-Down Network Design, Ch. 7: Selecting Switching and Routing Protocols. Top-Down Network Design. Selecting Switching and Routing Protocols

ET4254 Communications and Networking 1

Inter-networking. Problem. 3&4-Internetworking.key - September 20, LAN s are great but. We want to connect them together. ...

Chapter 4: Network Layer

Lecture 4 The Network Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061. Lecture 2. Internetworking IPv4, IPv6

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

The Internet. The Internet is an interconnected collection of netw orks.

Introduction to Networks and the Internet

Chapter 2 Advanced TCP/IP

The Internet Protocol (IP)

Network Layer PREPARED BY AHMED ABDEL-RAOUF

University of Toronto Faculty of Applied Science and Engineering. Final Exam, December ECE 461: Internetworking Examiner: J.

Protocols. End-to-end connectivity (host-to-host) Process-to-Process connectivity Reliable communication

The Internet Protocol. IP Addresses Address Resolution Protocol: IP datagram format and forwarding: IP fragmentation and reassembly

TCP/IP Networking. Training Details. About Training. About Training. What You'll Learn. Training Time : 9 Hours. Capacity : 12

The Network Layer. Internet solutions. Nixu Oy PL 21. (Mäkelänkatu 91) Helsinki, Finland. tel fax.

Internet Protocol. Outline Introduction to Internet Protocol Header and address formats ICMP Tools CS 640 1

Chapter 19 Network Layer: Logical Addressing

(Chapters 2 3 in Huitema) E7310/Internet basics/comnet 1

Layer 4: UDP, TCP, and others. based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers

Lecture 8. Network Layer (cont d) Network Layer 1-1

Examination 2D1392 Protocols and Principles of the Internet 2G1305 Internetworking 2G1507 Kommunikationssystem, fk SOLUTIONS

Lecture 11: IP routing, IP protocols

Internetworking - We are heterogeneity to our network (variable network technologies, bandwidth, MTU, latency, etc. etc.)

Operation Manual IPv4 Routing H3C S3610&S5510 Series Ethernet Switches. Table of Contents

ICS 451: Today's plan

Unit 3: Dynamic Routing

TSIN02 - Internetworking

Introduction to Internetworking

IP - The Internet Protocol

Chapter 4 Network Layer

IP : Internet Protocol

Networking Fundamentals

Internetworking With TCP/IP

CSC 401 Data and Computer Communications Networks

Packet Header Formats

ECE 428 Internet Protocols (Network Layer: Layer 3)

Lecture 4 - Network Layer. Transport Layer. Outline. Introduction. Notes. Notes. Notes. Notes. Networks and Security. Jacob Aae Mikkelsen

Quiz. Segment structure and fields Flow control (rwnd) Timeout interval. Phases transition ssthresh setting Cwnd setting

Module 7 Internet And Internet Protocol Suite

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link.

Transcription:

Session 8. TCP/IP Dongsoo S. Kim (dskim@iupui.edu) Electrical and Computer Engineering Indiana U. Purdue U. Indianapolis IP Packet 0 4 8 16 19 31 Version IHL Type of Service Total Length Identification Flags Fragment Offset Time to live Protocol Header checksum Source IP address Destination IP address Options Padding Version The current version is 4 Real-time stream protocol is 5 IPv6 uses 6 8-2 1

Version IHL Type of Service Total Length IP Packet, 2 IHL (Internet Header Length) In 32-bit word The default value is 5 (20 bytes) The maximum is 15 (60 bytes) TOS (Type of Service) 3-bit priority (precedence) Identification Flags Fragment Offset Time to live Protocol Header checksum Source IP address Destination IP address Options 4-bit specific requirement (delay, throughtput, reliability, cost) Ignored by most of IP routers Total Length In bytes Including header and data The maximum length is 65536 bytes Identification, Flags, and Fragment offset Used for fragmentation and reassembly Padding 8-3 Version IHL Type of Service Total Length IP Packet, 3 Identification Flags Fragment Offset Time to live Protocol Header checksum Source IP address TTL (Time To Live) Destination IP address The amount of time in seconds the packet is allowed to remain in the network Practically, indicate the number of hops the packet is allowed to travel Each router decrements this by one The router discards a packet with TTL=0, and send an error message Protocol 6 for TCP 17 for UDP 1 for ICMP Header checksum RFC 1071 Source IP address and Destination IP address Options Variable length For new protocols Padding To make the header a multiple of 32-bit words Options Padding 8-4 2

IP Address, Overview Two levels network ID and host ID A unique address to each computer? Dual-home server or router system has two or more IP addresses NAT (Network Address Translation) Address Classes 0 1 2 3 8 16 24 31 Class A 0 Network ID Host ID Class B 10 Network ID Host ID Class C 110 Network ID Host ID Class D 1110 Multicast address Class E 11110 Reserved for experiments 8-5 IP Address, Structure Network Classes Class A 7-bit net ID, 24-bit host ID Class B 14-bit net ID, 16-bit host ID Class C 21 bit net ID, 8-bit host ID Class D 28-bit group ID for multicast services (MBONE) Class E reserved Special Host ID All zeroes network address All ones broadcast address Eg) IUPUI has an class B address 10000110 01000100 10000110 01000100 10000110 01000100? 00000000 00000000 11111111 11111111 IUPUI Network broadcast to all hosts in IUPUI network 8-6 3

IP Address, Notation Dotted-decimal Notation Each byte is represented by a DECIMAL number, separated by a dot Example 10000110 01000100 00000001 00001001 134.68.1.9 Software Loopback address 127.x.y.z (mostly 127.0.0.1) 8-7 Subnet Addressing Problem of fixed IP hierarchy IUPUI has a class B address, which supports 65,536 hosts How to organize this many hosts A router supporting 2 24 hosts (Class A), 2 16 hosts (Class B) The size of routing table and the time complexity for searching Subnet - another hierarchical level Flexible and transparent Subnet mask Indication of (net ID + subnet ID) with binary 1 s The portion of host ID contains all 0 s Example - 11111111 11111111 11111111 10000000 (255.255.255.128) Notation of IP address (IP address/subnet mask) 134.68.6.132/255.255.255.128, or 134.68.6.132/25 Operation of subnet mask Network_address = IP & MASK // 134.68.6.128 Broadcast_address = IP ~MASK // 134.68.6.255 Network ID Subnet ID Host ID 8-8 4

Address Assignment with Subnet H1 134.68.6.149/25 H2 134.68.6.164/25 134.68.6.0/ 255.255.255.0 134.68.6.128/ 255.255.255.128 Internet R1 134.68.6.129/25 134.68.6.1/25 134.68.7.102 134.68.6.0/ 255.255.255.128 R2 H5 H6 134.68.6.74/26 134.68.6.100/26 134.68.6.60/25 134.68.6.64/ 255.255.255.192 134.68.6.9/25 134.68.6.54/25 134.68.6.65/26 H3 H4 8-9 IP Routing An IP packet is either sent directly to the destination host, or send to an appropriate router To reduce the size of table, group address can be used Routing Table Search Search an host ID (a complete destination ID) Search an group ID Search a default gateway Not found host unreachable ICMP packet Router If the destination address is not its own, refer the routing table to determine the next hop Routing table for H1 Destination 127.0.0.1 Mask 255.255.255.255 Next Hop 127.0.0.1 Flags H Interface Lo0 134.68.6.149 255.255.255.255 134.68.6.149 H Eth0 134.68.6.128 255.255.255.128 Direct G Eth0 Default Any 134.68.6.129 G Eth0 8-10 5

Classless Interdomain Routing (CIDR) Motivation Shortage of Class B address spaces No demand for Class C address spaces Gigantic Class A address spaces Solution Subnetting and Supernetting in routers with submask Supernet utilize contiguous class C addresses Routing Routing table with submask If there are two entries matching an address, use the longest prefix match first 205.100.0.0 205.100.1.0 205.100.2.0 205.100.3.0 Mask 1100 1101. 0110 0100. 0000 0000. 0000 0000 1100 1101. 0110 0100. 0000 0001. 0000 0000 1100 1101. 0110 0100. 0000 0010. 0000 0000 1100 1101. 0110 0100. 0000 0011. 0000 0000 1111 1111. 1111 1111. 1111 1100. 0000 0000 8-11 Address Resolution Protocol (ARP) Between IP and a DL protocol Operation A host know the destination IP address, but not the destination MAC address ARP Table list of IP and MAC address (initially empty and aged) If a host need a MAC address, send an ARP request with MAC address The intended host sends back an ARP response with a MAC address 134.68.6.12 08:00:5A:C5:3B:94 134.68.6.54 08:00:38:A4:3F:12 ARP Request - Broadcast 134.68.6.12 08:00:5A:C5:3B:94 134.68.6.54? ARP Response One2One 134.68.6.12 08:00:5A:C5:3B:94 134.68.6.54 08:00:38:A4:3F:12 8-12 6

Reverse Address Resolution Protocol (RARP) MAC address in a firmware; IP address in software Application Diskless X terminal Dynamic host configuration reuse IP address spaces RARP server Diskless X terminal 08:00:5A:C5:3B:94 RARP server 134.68.6.54 08:00:38:A4:3F:12 RARP Request - Broadcast? 08:00:5A:C5:3B:94 FF:FF:FF:FF:FF:FF RARP Response 134.68.6.12 08:00:5A:C5:3B:94 8-13 Fragmentation and Reassembly Maximum Transfer Unit (MTU) Ethernet 1500 bytes FDDI 4464 bytes An IP router can break an IP packet into smaller fragments whose size is no larger than the MTU of the forwarding physical network, unless it says don t The destination IP will reassemble the fragments. Note that intermediate routers won t reassemble them Fields for FAR (SAR:Segmentation and Reassembly) Identification Flags Fragment offset 8-14 7

Operation of FAR Identification The source host generates the unique ID Flags (3-bits) Unused bit DF bit (Don t Fragment) 1 force the router not to fragment the packet. If the packet length is greater than the MTU, the router will discard the packet and send an error message to the source MF bit (More Fragment) 1 tell the destination whether or not more fragments follow Offset Unit of 8-byte (why?) Between the beginning of the packet to be fragmented and the beginning of the fragment Intelligent Router (Switch) PPD (Partial Packet Discard) EPD (Early Packet Discard) 8-15 Example of FAR (34,000,0) Payload (1484 bytes) Router MTU=576 (34,000,138) Payload (380 bytes) 138x8=1104 (34,001,69) Payload (552 bytes) 69x8=552 (34,001,0) Payload (552 bytes) 8-16 8

Internet Control Message Protocol (ICMP) Send an error message back to the source to report routing problems To provide feedback, not to make IP reliable No ICMP message are sent about ICMP messages ICMP message are only sent about errors in handling fragment zero of fragmented datagrams Encapsulated by IP packets (Protocol=1) Type of ICMP Messages Destination Unreachable Message (3) Time Exceeded Message (11) Parameter Problem Message (12) Source Quench Message (4) Redirect Message (5) Echo Message(8) and Echo Reply Message (0) Timestamp Message (13) and Timestamp Reply Message (14) Information Request Message (15) and Information Reply Message (16) 8-17 User Datagram Protocol (UDP) Unreliable and connectionless Main functions: demultiplexing and error checking Applications TFTP (Trivial File Transfer Protocol) DNS (Domain Name System) SNMP (Simple Network Management Protocol) RTP (Real-time Transport Protocol) No checksum is calculated if the UDP checksum field contains all zero 0 Source Port UDP Length 16 31 Destination Port UDP Checksum Data 8-18 9

Transmission Control Protocol (TCP) Connection-oriented, reliable, in-sequence, byte-stream, flow control Main functions Acknowledge Selective repeat ARQ Long sequence number to count the number of bytes (32bits, count up to 4 Gigabytes) Flow control Dynamic advertised window Advertised window size = buffer size (R new R next ) R new : the highest numbered byte that has been received correctly R next : the lowest numbered byte that has not yet been received correctly (the next byte it expects to receive) Retransmission Set a timer each time a segment is transmitted How much do we need to set? (Dynamic behavior of TCP/IP) Adaptive timer using the average round-trip time (t RTT ) Averaging samples in a real-time? Too much overhead! 8-19 Exponential Mean and Deviation The Fourth Mean, after arithmetic mean, harmonic mean, and geometric mean The weights α and β instruct how fast they can forget the history Suitable for a real-time computation One sample at a time Modification to an integer operation (addition, subtraction, multiplication, shift, but no division and floating-point) For samples x, x, L, x, x 1 2 n n+ 1, mean t = αt + (1 α) x deviation d n n = βd n 1 n 1 n + (1 β ) x n t n 8-20 10

Timeout Calculation t out = t + cd n n Notation t n : exponential mean of round-trip time d n : exponential deviation of round-trip time c: some constant If the round-trip time is highly fluctuated, then a larger timeout value is used If the round-trip time is stable, the timeout value is slightly larger than the mean 8-21 TCP Format, Overview 0 4 10 16 31 Source Port Destination Port Sequence Number Acknowledgement Number Header Length Reserved U R G A C K P S H R S T S Y N F I N Window Size Checksum Urgent Pointer Options Padding Data 8-22 11

TCP Format, 1 Source port and Destination port: identify the sending and receiving applications Sequence number: the first data byte of this segment For the initial connection establishment (SYN=1), it is the init ial sequence number (ISN) Acknowledgement number: the sequence number of the next data byte expected to receive Header Length: the length of the TCP header in 32-bit words (to handle the variable option field) URG: the urgent field is valid if this is set ACK: the acknowledgement number filed is valid if this is set PSH: tells the receiver to handle this packet immediately (Flush) RST: tells the receiver to abort the connection (Reset) SYN: requests a connection FIN: tell the receiver there is no more data left (Final) 8-23 TCP Format, 2 Window size: dynamic advertised window size Checksum Urgent point: sequence # + urgent pt = the last byte of urgent data if URG=1 Options MSS (Maximum Segment Size) during connection setup 8-24 12

TCP, Connection Establishment Three-way Handshake Host A Host B SYN, Seq_no = x SYN, Seq_no = y, ACK, Ack_no = x+1 Seq_no = x+1, ACK, Ack_no = y+1 8-25 TCP, Client/Server connect (blocks) Host A (Client) socket connect returns Write read (blocks) read returns SYN, Seq_no = x SYN, Seq_no = y, ACK, Ack_no = x+1 Seq_no = x+1, ACK, Ack_no = y+1 request message reply message Host B (Server) socket bind listen accept (blocks) accept returns read (blocks) read returns write read (blocks) 8-26 13

TCP, Data Transfer Host A Seq_no = 1, Ack_no = 2000, Win = 2048, No Data Host B t 0 t 1 Seq_no = 2000, Ack_no = 1, Win = 1024, Data = 2000-3023 t 2 Seq_no = 3024, Ack_no = 1, Win = 1024, Data = 3024-4047 piggyback t 4 Seq_no = 1, Ack_no = 4048, Win = 512, Data = 1-128 Adjust window Seq_no = 4048, Ack_no = 129, Win = 1024, Data = 4048-4559 t 3 8-27 TCP, Connection Termination Host A Host B FIN, seq = 5086 ACK = 5087 Deliver 150 bytes Data, seq. = 303, ACK = 5087 ACK = 453 FIN, seq. =453, ACK = 5087 ACK = 454 8-28 14

Dynamic Host Configuration Protocol (DHCP) On BOOTP (Bootstrap Protocol), port # 67 for server, 68 for client Diskless workstation to be remotely booted up Assign temporary IP addresses to hosts Operation Broadcast DHCP Discover message The server responds with a DHCP Offer message (IP address and other configuration information) Select one DHCP offer among servers, and broadcast a DHCP Request message with the ID of the server The server sends a DHCP ACK message and assigns the IP address for some period of time The host can extend the expiration time 8-29 Overview of Routing Protocols Autonmous System (AS) Stub AS single-homed AS Multihomed AS multiple connection to the outside but no transit traffic Transit AS multiple connection to the outside and carry transit and local traffic Globally unique AS number (ASN) Classes of routing protocols Interior Gateway Protocol (IGP) within an AS, use IP addresses Deal with performance Routing Information Protocol (RIP) Open Shortest Path First (OSPF) Exterior Gateway Protocol (EGP) among AS s, use AS numbers Deal with policies Border Gateway Protocol (BGP) 8-30 15

Routing Information Protocol (RIP) Based on distance-vector algorithm Operating on UDP port number 520 Metrics the number of hops (maximum=15 and infinity=16) Exchange update message every 30 sec Use split horizon with poisoned reverse for a fast convergence The minimum cost to a given destination(y) is set to infinity if the neighbor(z) is the next node along the shortest path. A --- X --- Z -*- Y Z sends the infinity minimum cost(y) to X X sends the infinity minimum cost(y) to A 8-31 RIP Format Command 1 : request the other system to send its routing info 2 : response containing the routing info Version 1 : RIP-1, 2 : RIP-2 Addr Family ID (2 for IP) IP Address : Destination address either a network or host address Metric : # of hops to the destination in the range of 1 to 15, infinity(16) 0 8 16 31 Command Version Zero Addr Family ID Zero IP address Zero Zero Metric RIP Entry Other RIP entries 8-32 16

Open Shortest Path First (OSPF) Base on the link-state routing algorithm IGP Features Multiple routes to a given destination, one for each IP TOS Support CIDR (Classless InterDomain Routing) Flexible link cost (16-bit) Load balancing over multiple paths Authentication for trusted neighbors Multicast rather than broadcast Election of designated router 8-33 OSPF, Basic Areas in OSPF Area ID (32 bit) Special area in an AS (backbone area: 0.0.0.0) Types of routers in OSPF Internal router all links in the same area Area border router links connected to more than one area ABR summarizes one area information Backbone router links to the backbone AS border router links to another AS 8-34 17

OSPF, Sample N1 R1 N2 Internal Router Area Border Router Backbone Router R3 R4 To another AS Backbone Router AS Broder Router Area Border Router Backbone Router R6 N4 N5 R7 Internal Router Internal Router R2 Area 0.0.0.0 R5 N3 Area 0.0.0.1 R8 N7 Area Border Router Backbone Router Backbone Router Area 0.0.0.3 N6 Area 0.0.0.2 8-35 OSPF, Format Run directly over IP (Protocol 89) OSPF Header Packet Format Type Hello, Database description, Link-state request, Link-state update, Link-state acknowledgements OSPF Header Version (2) Type Packet Length (in byte) Router ID (sending router) Area ID Checksum Authentication type Authentication Authentication Data 8-36 18

OSPF, Operation Stage 1: discovery of neighbors, and election of designated routers Transmit hello packet to each interface every 10 sec Respond the hello packet attaching router Ids it has seen Elect designated router based on the priority and ID Stage 2: Establishing adjacencies and synchronizing database database description Flood link-state info within the area only ABR summarizes the info, and sends them to other area routers and ASBRs Stage 3: Propagation of link-state info, and building of routing table link-state request, link-state update, and link-state ack Use reliable flooding Repeated link-state update until receiving its acknowledge 8-37 Reading Assignment Leon-Garcia and Widjaja Communication Networks: Fundamental Concepts and Key Architecture 2000, pp 544 618 8-38 19