TCP/IP and OSI model. TCP/IP Protocol (2) B.2

Similar documents
IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

RARP: Reverse Address Resolution Protocol

Ethernet. Ethernet. Network Devices

IP address format: Dotted decimal notation:

8.2 The Internet Protocol

Internet Protocols. Background CHAPTER

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

Lecture Computer Networks

Transport Layer. Chapter 3.4. Think about

Transport Layer Protocols

Networking Test 4 Study Guide

TCP/IP and the Internet

IP - The Internet Protocol

Indian Institute of Technology Kharagpur. TCP/IP Part I. Prof Indranil Sengupta Computer Science and Engineering Indian Institute of Technology

Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP

Subnetting,Supernetting, VLSM & CIDR

Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme. Auxiliary Protocols

How do I get to

Network Programming TDC 561

Lecture 15. IP address space managed by Internet Assigned Numbers Authority (IANA)

Network Layer: Network Layer and IP Protocol

Address Resolution Protocol (ARP), Reverse ARP, Internet Protocol (IP)

Transport and Network Layer

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

2. What is the maximum value of each octet in an IP address? A. 28 B. 255 C. 256 D. None of the above

IP Addressing. -Internetworking (with TCP/IP) -Classful addressing -Subnetting and Supernetting -Classless addressing

Mobile IP Network Layer Lesson 02 TCP/IP Suite and IP Protocol

Internet Control Protocols Reading: Chapter 3

Network-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2

Internet Protocols. Addressing & Services. Updated:

04 Internet Protocol (IP)

Internet Architecture and Philosophy

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

Objectives of Lecture. Network Architecture. Protocols. Contents

Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.

Network Security TCP/IP Refresher

Internet Protocol Address

PART IV. Network Layer

Internetworking and Internet-1. Global Addresses

NETWORK LAYER/INTERNET PROTOCOLS

IP Addressing A Simplified Tutorial

Computer Networks. Chapter 5 Transport Protocols

Understanding TCP/IP. Introduction. What is an Architectural Model? APPENDIX

Gary Hecht Computer Networking (IP Addressing, Subnet Masks, and Packets)

SUPPORT DE COURS. Dr. Omari Mohammed Maître de Conférences Classe A Université d Adrar Courriel : omarinmt@gmail.com

Overview of TCP/IP. TCP/IP and Internet

EITF25 Internet Techniques and Applications L5: Wide Area Networks (WAN) Stefan Höst

DO NOT REPLICATE. Analyze IP. Given a Windows Server 2003 computer, you will use Network Monitor to view and analyze all the fields of IP.

Chapter 11. User Datagram Protocol (UDP)

Computer Networks. Lecture 3: IP Protocol. Marcin Bieńkowski. Institute of Computer Science University of Wrocław

Internet Addresses (You should read Chapter 4 in Forouzan)

TCP/IP Networking Terms you ll need to understand: Techniques you ll need to master:

Internet Protocol version 4 Part I

Lecture 8. IP Fundamentals

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

Chapter 9. IP Secure

Introduction to IP networking

Network Layer: Address Mapping, Error Reporting, and Multicasting

2. IP Networks, IP Hosts and IP Ports

Introduction to TCP/IP

Understanding Layer 2, 3, and 4 Protocols

Technical Support Information Belkin internal use only

Internetworking. Problem: There is more than one network (heterogeneity & scale)

Computer Networks UDP and TCP

Savera Tanwir. Internet Protocol

Chapter 3: Review of Important Networking Concepts. Magda El Zarki Dept. of CS UC Irvine

Protocols and Architecture. Protocol Architecture.

(Refer Slide Time: 02:17)

Interconnection of Heterogeneous Networks. Internetworking. Service model. Addressing Address mapping Automatic host configuration

IP Subnetting and Addressing

Protocol Data Units and Encapsulation

Future Internet Technologies

PART OF THE PICTURE: The TCP/IP Communications Architecture

Networking Overview. (as usual, thanks to Dave Wagner and Vern Paxson)

Network Layer IPv4. Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS. School of Computing, UNF

Introduction to IP v6

Internet Protocol (IP) IP - Network Layer. IP Routing. Advantages of Connectionless. CSCE 515: Computer Network Programming IP routing

Outline. CSc 466/566. Computer Security. 18 : Network Security Introduction. Network Topology. Network Topology. Christian Collberg

Internetworking and IP Address

Final for ECE374 05/06/13 Solution!!

CS335 Sample Questions for Exam #2

Algorithms and Techniques Used for Auto-discovery of Network Topology, Assets and Services

2. What is the maximum value of each octet in an IP address? A. 128 B. 255 C. 256 D. None of the above

Computer Networks/DV2 Lab

Network layer: Overview. Network layer functions IP Routing and forwarding

TCP/IP Basis. OSI Model

[Prof. Rupesh G Vaishnav] Page 1

Topics. Subnetting. The Basics of Subnetting Subnet Mask Computing subnets and hosts Subnet Routing Creating a Subnet Example of Subnetting 1/37

Network Models OSI vs. TCP/IP

q Connection establishment (if connection-oriented) q Data transfer q Connection release (if conn-oriented) q Addressing the transport user

Network layer" 1DT066! Distributed Information Systems!! Chapter 4" Network Layer!! goals: "

Expert Reference Series of White Papers. Basics of IP Address Subnetting

Networks: IP and TCP. Internet Protocol

Basic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet

Slide 1 Introduction cnds@napier 1 Lecture 6 (Network Layer)

A PPENDIX L TCP/IP and OSI

- IPv4 Addressing and Subnetting -

TCP/IP Network Essentials. Linux System Administration and IP Services

Unix System Administration

The Internet. Internet Technologies and Applications

Transcription:

TCP/IP Protocol TCP/IP Transmission Control Protocol/Internetworking Protocol (TCP/IP) standard for the Internet five layers = physical = data link = network = transport = application B.1

TCP/IP and OSI model TCP/IP Protocol (2) B.2

IP protocol IP transports data in packets called datagrams. IP is an unreliable and connectionless datagram protocol -- a best-effort delivery service. = Best-effect means that IP provides no error checking or tracking. = Example of best-effort delivery service: post office The post office does its best to deliver the mail but dos not always succeed. If an unregistered letter is lost, it is up to the sender or would-be recipient to discover the loss and rectify the problem. The post office itself does not keep track of every letter and cannot notify a sender of loss or damage. B.3

Datagram A datagram is a variable-length packet consisting of two parts: = header = data B.4

Datagram (2) Version: version number of the IP. The current version is 4 (IPv4), with a binary value of 0100. Header length (HLEN): the length of the header. Service type: specify the type of service the sender desires such as the level of throughput, reliability, and delay. Total length: total length of the IP datagram. B.5

Datagram (3) Identification, Flags and Fragmentation offset: = used in fragmentation. = A datagram when passing through different networks, may be divided into fragments to match the network frame size. Time to live: defines the number of hops a datagram can travel before it is discarded. Protocol: defines which upper-layer protocol data are encapsulated in the datagram (TCP, UDP, ICMP) B.6

Datagram (4) Header checksum: to check the integrity of the header, not the rest of the packet. Source address: identifies the original source of the datagram. Destination address: identifies the final destination of the datagram. Options: network testing, security, and others. B.7

Addressing In addition to the physical addresses (MAC addresses at Layer 2), the Internet requires an additional address for identifies the connection of a host to its network. Internet address 4 bytes Class type, netid, and hostid B.8

Addressing (2) Netid: identifies the network to which a host is attached. The length of Netid and Hostid depends on the class of the address Example: 10011110 10000100 00001110 00000001 = 158.132.14.1 Hostid Netid B.9

Addressing (2) The network number is managed ARIN (American Registry for Internet Number) The host number is managed by network administrators. B.10

Classes Five classes Different classes are designed to cover the needs of different types of organization. B.11

Classes (2) Example, for class A networks, the maximum number of hosts is 2 24 = 16.8 millions for class networks, the maximum number of hosts is 2 16 = 66 thousands B.12

Classes (3) Example, the decimal notation of the first byte: Class A is 0-127 (00000000-011111111) Class B is 128-191 (10000000-10111111) Class C is 192-223 (11000000-11011111) Class D is 224-239 (11100000-11101111) Class E is 240-255 (11110000-11111111) Our campus network is a class B network as our address is 158.XXX.XXX.XXX B.13

Classes (4) For the whole address, we have B.14

Classes (5) Class D is reserved for multicast address. = Multicasting allows copies of a datagram to be passed to a select group of hosts rather than to an individual host B.15

Classes (6) Example, Network address B.16

Subnetting Subnetting division of network into smaller networks Example: a class B network with two levels of hierarchy (not subnetted) B.17

Subnetting (2) A network with three levels of hierarchy (subnetted) Traffic can be reduced B.18

Subnetting (3) In this example, a packet destined for host 141.14.21 still reaches router R1. The destination address of the IP datagram is still a class B address where 141.14 defines the netid and 2.21 defines the hostid. However, when the packet arrives at router R1, the interpretation of the IP address changes. Router R1 knows that the network 141.14 is physically divided into three sub-networks. It knows that the last two octets (2.21) define two things: = subnetid = hostid B.19

Subnetting (4) Example B.20

Subnetting (5) Example: consider a class B network, the IP structure is If subnetting is used, we borrows bits from the hostid field and designates them as the subnetid field. Any number of bits can be borrowed, as long as 2 bits remain. Example: 16 bits for netid 4 bits for subnetid 12 bits for hostid B.21

Subnetting (6) Subnet Mask all bits for netid and subnetid are 1 all bits for hostid are 0 Example: the subnet mask of the previous example is 11111111 11111111 11110000 00000000 In decimal notation, it is 255.255.240.0 B.22

Subnetting (7) Masking to extracts the address of the physical network from an IP address. B.23

Subnetting (8) The network address is extracted using the bit-wise AND operator. Example The binary form of the IP address 141.14.2.21 is 10001101 00001110 00000010 00010101 The binary form of the mask 255.255.255.0 is 11111111 11111111 11111111 00000000 Taking AND operation, the result is 10001101 00001110 00000010 00000000 = 141.14.2.0 B.24

Subnetting (8) Broadcasts IP addresses ending in all binary ones are reserved for broadcasts. The same is true for subnetworks. Example, for a Class B network (without subnetting) with network number 158.132.0.0, the IP address for broadcasts is 158.132.255.255 Example, for a Class B network (with 8 bits used for subnetting) with subnetwork number 158.132.14.0, the IP address for broadcasts is 158.132.14.255. B.25

Subnetting (9) Example, for a Class B network (with 4 bits used for subnetting) with subnetwork number 158.132.160.0, the IP address for broadcasts is 158.132.?.? B.26

Subnetting (10) Example: A Class C network has been assigned address 201.222.5.0. Assume that 20 subnets are needed, with 5 hosts per subnet. We can subdivide the last octet (8 bits) into a subnet and a host portion, and then determine what the subnet mask will be. 1. Select a subnet field size that yields enough subnetworks. Now, we choose 5 bits for subnetting (2 5-2=30 > 20 and 2 (8-5) -2=6 > 5). B.27

Subnetting (11) 2. The subnet mask is 255.255.255.248 (29-bit mask). 3. The subnet addresses are all multiples of 8, i.e., 201.222.5.16, 201.222.5.32,... B.28

ARP Address Resolution Protocol (ARP) A data packet must contain both a destination physical address and a destination Internet Protocol (IP) address. If the data packet lacks one of these addresses, the data will not be passed to the upper levels. Example: = physical address: 02-60-8C-01-02-03 = IP address: 158.132.14.1 B.29

ARP (2) Example: When the source has determined the IP address for the destination, the source looks into the ARP table in order to locate the physical address for the destination. B.30

ARP (3) If the source locates a mapping of the destination IP address to the destination physical address, it binds the IP address with the physical address and uses them to encapsulate the data. B.31

ARP (4) However, if the NIC on a particular machine fails, the physical address changes. ARP is used to find the physical address of the node when its IP address is known. When a host, or a router, needs to find the physical address of another host on its network, it formats an ARP query packet that includes the IP address and broadcasts it over the network. B.32

ARP (5) Every host on the network receives and processes the ARP packet B.33

ARP (6) Only the intended recipient recognizes its internet address and sends back its physical address. B.34

RARP Reverse Address Resolution Protocol (RARP) allows a host to discover its IP address when it knows only its physical address. RARP is normally used when the host is a diskless computer or the computer is being connected to the network for the first time. B.35

RARP (2) The host wishing to retrieve its internet address broadcasts an RARP query packet that contains its physical address to every host on its physical network. A server on the network recognizes the RARP packet and returns the host s internet address. B.36

ICMP Internet Control Message Protocol (ICMP) used by hosts and routers to send notification of datagram problems back to the sender. Example: = If a router is unable to route or deliver the datagram because of unusual conditions (disabled links, or device is on fire) or because of network congestion, ICMP allows it to inform the original source. B.37

ICMP (2) Example B.38

ICMP (3) ICMP uses echo test to test whether a destination is reachable and responding. B.39

ICMP (4) Example: Destination unreachable B.40

ICMP (5) Example: Non-existence address B.41

Transport Layer The transport layer performs two functions flow control, which is provided by sliding windows reliability, which is provided by sequence numbers and acknowledgments. Two protocols TCP (Transmission Control Protocol) = for reliable end-to-end delivery UDP (User Datagram Protocol) = provides nonsequenced transport functionality when reliability and security are less important than size and speed. B.42

Transport Layer (2) The IP delivers a datagram from a source host to a destination host, making it a host-to-host protocol. However, a host receiving a datagram may be running several different concurrent processes (i.e. programs), any one of which is a possible destination for the transmission. The transport protocols of the TCP/IP suite define a set of conceptual connections to individual processes called ports. TCP/IP s transport level protocols are port-toport protocols. B.43

Transport Layer (3) Application software developers agree to use wellknown port numbers for some applications. Example B.44

Transport Layer (4) Example: Originating port number is dynamically assigned by the source host (usually >1023) End host use the port number to select application (telnet is 23) B.45

UDP An end-to-end transport protocol that adds only port addresses, checksum error control, and length information to the data from the upper layer. B.46

UDP (2) UDP does not provide any sequencing or reordering functions and cannot specify the damaged packet when reporting an error (for which it must be paired with ICMP). = UDP can discover that an error has occurred. = ICMP can then inform the sender that a user datagram ( not a specific datagram) has been damage and discarded. B.47

TCP TCP is a reliable stream transport port-to-port protocol. Stream means connection oriented. = A connection must be established between both ends of a transmission before either may transmit data. B.48

TCP (2) By creating this connection, TCP generates a virtual circuit between sender and receiver that is active for the duration of a transmission. TCP begins each transmission by alerting the receiver that datagrams are on their way and ends each transmission with a connection termination. B.49

TCP (3) UDP vs TCP UDP treat multiple datagrams belonging to a single transmission as entirely separate unit, unrelated to each other. TCP is responsibility for the reliable delivery of the entire stream of bits contained in the message originally generated by the sending application. = All segments must be received and acknowledged before the transmission is considered complete and the virtual circuit is discarded. B.50

TCP (4) TCP segment At the sending end of each transmission, TCP divides long transmissions into small data units and packages each into a frame called a segment. Segments are carried across network links inside of IP datagrams. At the receiving end, TCP collects each datagram as it comes in and reorders the transmission based on sequence numbers. B.51

TCP segment TCP segment B.52

TCP segment (2) Source port address the source port address defines the application program in the source computer. Destination port address the destination port address defines the application program in the destination computer. For example, 23 for telnet. B.53

TCP segment (3) Sequence number A stream of data from the application program may be divided into two or more TCP segments. The sequence number field shows the position of the data in the original data stream. Acknowledgment number to acknowledgment the receipt of data from the other communication device. This number is valid only if the ACK bit in the control field is set. In this case, it defines the byte sequence number that is next expected. B.54

TCP segment (4) HLEN Header length Reserved reserved for future use URG, ACK, PSH, RST, SYN, FIN Control bits URG (urgent bit): when set, the data in the segment are urgent. B.55

TCP segment (5) ACK: when set, validates the acknowledgment number field. PSH: to inform the sender that a higher throughput is needed. RST (reset): used to reset the connection when there is confusion in the sequence numbers. SYN: used for sequence number synchronization. FIN: used in connection termination. B.56

TCP segment (6) Window size defines the size of the sliding window Checksum used in error detection. Urgent pointer the sender is informing the receiver that there are urgent data in the data portion of the segment. This pointer defines the end of the urgent data and the start of normal data. B.57

TCP three-way handshake Before either communication device can send data to the other, the initiating device must first determine the availability of the other to exchange data and a pathway must be found through the network by which the data can be sent. This step is called connection establishment. Connection establishment requires three actions in what is called a three-way handshake. = Connection request = Connection confirmation = Acknowledgment confirmation B.58

TCP three-way handshake (2) Example: TCP three-way handshake Station must synchronize each other s initial sequence numbers A->B SYN (Seq=X) B->A ACK B->A SYN (Seq=y,ACK=x+1) A->B ACK (ACK=y+1) B.59

Connection termination TCP three-way handshake (3) B.60

Flow Control Flow control is a set of procedure that tells the sender how much data it can transmit before it must wait for an acknowledgment from the receiver. Stop-and-wait Sliding window B.61

Flow Control (2) Stop-and-wait Sender wait for an acknowledgment after every frame it send. Inefficiency B.62

Flow Control (3) Sliding window the sender can transmit several frames before needing an acknowledgment. More efficient. B.63

Flow Control (4) The sliding window refers to imaginary boxes at both the sender and the receiver. This window can hold frames at either end and provides the upper limit on the number of frame that can be transmitted before requiring acknowledgment. Frames may be acknowledged at any point without waiting for the window to fill up and may be transmitted as long as the window is not yet full. B.64

Flow Control (4) For window size n, the frames are numbered 0,1,2,3,,n-2,n-1,0,1,2, Example n=7 B.65

Flow Control (5) Sender window As frames are sent out, the left boundary of the window moves inward, shrinking the size of the window. Once an ACK arrives, the window expands. B.66

Flow Control (6) Receiver window As new frames come in, the size of the receiver window shrinks. As soon as an acknowledgment is sent, the window expands. B.67

Flow Control (7) Example B.68