1 / 80

TCP/IP

TCP/IP. Babu Ram Dawadi. What is TCP/IP?. TCP/IP is a set of protocols developed to allow cooperating computers to share resources across a network. TCP stands for “Transmission Control Protocol” IP stands for “Internet Protocol”

dkeys
Download Presentation

TCP/IP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TCP/IP Babu Ram Dawadi

  2. What is TCP/IP? • TCP/IP is a set of protocols developed to allow cooperating computers to share resources across a network. • TCP stands for “Transmission Control Protocol” • IP stands for “Internet Protocol” • They are Transport layer and Network layer protocols respectively of the protocol suite • The most well known network that adopted TCP/IP is Internet – the biggest WAN in the world

  3. What is a protocol? • A protocol is a collection of rules and procedures for two computers to exchange information • Protocol also defines the format of data that is being exchanged

  4. Why TCP/IP? • TCP/IP was developed very early • Technologies were widely discussed and circulated in documents called “Request for Comments” (RFC) – free of charge • Supported by UNIX operating system

  5. TCP/IP model • Because TCP/IP was developed earlier than the OSI 7-layer mode, it does not have 7 layers but only 4 layers Application Transport Internet Host -Network

  6. Application layer • Application layer protocols define the rules when implementing specific network applications • Rely on the underlying layers to provide accurate and efficient data delivery • Typical protocols: • FTP – File Transfer Protocol • Telnet – Remote terminal protocol • SMTP – Simple Mail Transfer Protocol • HTTP – Hypertext Transfer Protocol

  7. Transport layer • TCP/IP is built on “connectionless” technology, each datagram finds its own way to its destination • Transport Layer protocols define the rules of • Dividing a chunk of data into segments • Reassemble segments into the original chunk • Typical protocols: • TCP – Transmission Control Protocol • Provide further the functions such as reordering and data resend • UDP – User Datagram Service • Use when the message to be sent fit exactly into a datagram • Use also when a more simplified data format is required

  8. Network layer • Network layer protocols define the rules of how to find the routes for a packet to the destination • It only gives best effort delivery. Packets can be delayed, corrupted, lost, duplicated, out-of-order • Typical protocols: • IP – Internet Protocol • Provide packet delivery • ARP – Address Resolution Protocol • Define the procedures of network address / MAC address translation • ICMP – Internet Control Message Protocol • Define the procedures of error message transfer

  9. Example: Mail

  10. Application layer: SMTP

  11. SMTP • The underlying layers have guaranteed accurate data delivery • We need to make a lot of agreements with the server in application layer before sending mail 1. Agree on how data is represented • Binary or ASCII 2. Ensure the right recipient • There may be 1000 users served by the server 3. Ensure the client has the right to send mail • Some clients are not welcome 4. How to tell the server it is the end of the message • All mail looks the same

  12. SMTP • The following mail is to be sent: • Date: Fri, 18 Jan 09 13:26:31 EDT • From: jack@ioe.edu.np • To: ninja@stad.edu • Subject: meeting • Let’s get together Monday at 1pm.

  13. Client Server Access Port No 25 of Server 220 stad.edu SMTP Service at 20 Jan 09 05:17:18 EDT HELO ioe.edu.np 250 stad.edu – Hello, ioe.edu.np MAIL From: <jack@ioe.edu.np> 250 MAIL accepted

  14. Client Server Access Port No 25 of Server RCPT to: <ninja@stad.edu> 250 Recipient accepted DATA 354 Start mail input; end with . • Date: Fri, 18 Jan 09 13:26:31 EDT • From: jack@ioe.edu.np • To: ninja@stad.edu • Subject: meeting • Let’s get together Monday at 1pm.

  15. SMTP • The agreement made in the SMTP protocol • All messages use normal text • All ASCII characters • The responses all begin with numbers • To indicate the status when receiving the command • Some words are reserved words • HELO, MAIL, RCPT… • Mail ends with a line that contains only a period • The information passed with the SMTP messages • The recipient name • The sender name • The mail

  16. Domain Name • Every computer has a network address • e.g. 158.132.161.99 • To access a computer, we need to specify its network address • Human beings are weak in memorizing numbers • We prefer computer name or domain name • e.g. v6gate.ioe.edu.np • Need a machine on the Internet to convert name to number

  17. Domain name hierarchy • Example: v6gate.ioe.edu.np Computer Name Root domain name other examples: com – commercial company org – general organization net – major network centre gov – government org. mil – militrary group edu – education org. The domain within edu.np One of the educational institutions in NP The domain within NP Note: edu.np is not the same as edu

  18. Domain name registration • An organization needs to register its domain name • e.g. ioe has registered its name to the domain of edu.np • Once a domain name is assigned, the organization is free to assign other names belong to its domain • e.g. we can have • election.ioe.edu.np • Fsu.ioe.edu.np • mail.ioe.edu.np • ----

  19. Domain name resolution

  20. Domain name resolution • Nevertheless, such a complicated procedure needs not perform in most cases • Client computers usually remember the answers that it got before (DNS Cache) • It reduces the loading to the root DNS • To further reduce loading, there can be many root DNS on the Internet • e.g. there are a few “com” root DNS

  21. Transport layer

  22. TCP • TCP - Transmission control protocol • TCP is a connection-oriented protocol • Does not mean it has a physical connection between sender and receiver • TCP provides the function to allow a connection virtually exists – also called virtual circuit • TCP provides the functions: • Dividing a chunk of data into segments • Reassembly segments into the original chunk • Provide further the functions such as reordering and data resend • Offering a reliable byte-stream delivery service

  23. Dividing and reassembly

  24. Dividing and reassembly • A Typical Procedure • Sender • TCP divides a message into segments • Add sequence no. • Send the segments in sequence and wait for acknowledgement • If an acknowledgement for a segment is not received for a certain period of time, resend it until an acknowledgement is received • Recipient • When receiving segments, send the acknowledgement with correct number • Reassembly the segments back to the message

  25. Port multiplexing • A computer may perform a number of network applications at the same time • FTP + SMTP + HTTP, etc. • Each computer has only one network address, how can it serve so many applications at the same time? • Port multiplexing.

  26. Some port numbers • Some port numbers are reserved for some purposes • Port 21: FTP – file transfer • Port 25: SMTP – mail transfer • Port 23: TELNET – remote login • Port 80: HTTP – Web access • These port numbers are well known to all computers in the network • E.g. whenever a client access port 25 of the server, it means the client needs SMTP service

  27. Ports

  28. Network layer

  29. Network interface

  30. Assignment of Protocols to Layers

  31. Layered Communications • An entity of a particular layer can only communicate with: 1. a peer layer entity using a common protocol (Peer Protocol) 2. adjacent layers to provide services and to receive services

  32. N+1 Layer Peer Protocol Request Delivery IndicateDelivery Layered Communications A layer N+1 entity sees the lower layers only as a service provider N+1 LayerEntity N+1 LayerEntity Service Provider

  33. Service Access Points • A service user accesses services of the service provider at Service Access Points (SAPs) • A SAP has an address that uniquely identifies where the service can be accessed

  34. Exchange of Data • The unit of data send between peer entities is called a Protocol Data Unit (PDU) • For now, let us think of a PDU as a single packet • Scenario: Layer-N at A sends a layer-N PDU to layer-N at B • What actually happens: • A’s layer-N passes the PDU to one the SAPs at layer-N-1 • Layer-N-1 entity at A constructs its own (layer-N-1) PDU which it sends to the layer-N-1 entity at B • PDU at layer-N-1 = layer-N-1 Header + layer –N PDU A B

  35. Exchange of Data A B

  36. Layers in the Example

  37. Send IP data-gram to 128.143.71.21 Frame is an IP datagram Frame is an IP datagram IP datagram is a TCP segment for port 80 Send HTTP Request to neon Establish a connection to 128.143.71.21 at port 80 Open TCP connection to 128.143.71.21 port 80 Send IP datagram to 128.143.71.21 Send a datagram (which contains a connection request) to 128.143.71.21 Send the datagram to 128.143.137.1 Send the datagram to 128.143.7.21 Send Ethernet frame to 00:e0:f9:23:a8:20 Send Ethernet frame to 00:20:af:03:98:28 Layers in the Example

  38. Different Views of Networking • Different Layers of the protocol stack have a different view of the network. This is HTTP’s and TCP’s view of the network.

  39. Network View of IP Protocol

  40. Network View of Ethernet • Ethernet’s view of the network

  41. IP Addresses • IP (Version 4) Addresses are 32 bits long • IP Addresses Assigned Statically or Dynamically (DHCP) • IPv6 addresses are 128 bits long

  42. A B C 0 nethost 1 0net host 110nethost 1724 bits 21416 bits 3218 bits IPv4 Addresses • 4 8-bit numbers (Hierarchical) • Specifies both network and host • Number of bits allocated to specify network varies • Three classes: 18.26.0.1 host network 32-bits

  43. IPv4 address: a 32-bit number, usually written in dotted decimal form, that uniquely identifies an interface of some computer • Host Address: another term for IP address • Network: a group of hosts, all of which have an identical beginning position of their ip addresses. • Network Number: a 32-bit number that represent a network and it cant be assigned as ip address of a host • Network address: another term for the network number. • Broadcast address: a 32-bit number that is used to address all hosts in the network. It cant be assigned as an ip address of a host.

  44. Subnet: a group of hosts, all of which have an identical portion of their ip addresses, a subnet differs from a network in that a subnet is a further subdivision of a network. • Subnet number: a 32-bit number that represent a subnet. It cant be assigned as ip address of host. • Subnet address: another term for the subnet number. • Subnet broadcast address: a 32-bit number, that is used to address all hosts in the subnet. It cant be assigned into an host’s ip address.

  45. Subnetting: the process of subdividing networks into smaller subnets. • Subnet mask: A 32-bit combination used to describe which portion of an address refers to the subnet and which part refers to the host. • Network mask: 32-bit number. The mask is used by computers to calculate the network number of a given IP address by performing a Boolean AND operation of the address and mask. • Address mask: another term for a mask • Interface: A network connection.

  46. Network Mask • Class A: 255.0.0.0 • Class B: 255.255.0.0 • Class C: 255.255.255.0 8.20.15.1 = 00001000.00010100.00001111.00000001 255.0.0.0 = 11111111.00000000.00000000.00000000 ----------------------------------- net id | host id netid = 00001000 = 8 hostid = 00010100.00001111.00000001 = 20.15.1 Class A IP_Addr Class A Mask

  47. Understanding Subnetting • Subnetting allows you to create multiple logical networks that exist within a single Class A, B, or C network • When sub-netting, a third part of IP address appears in the middle of the address—namely, the subnet part of the address. The size of the network part never shrinks.

  48. Subnetting • given a Class C network of 204.17.5.0 which has a natural mask of 255.255.255.0, you can create subnets in this manner: 204.17.5.0 - 11001100.00010001.00000101.00000000 255.255.255.224 - 11111111.11111111.11111111.11100000 --------------------------|sub|---- With these three subnetbits, it is possible to create eight subnets

  49. Sunetting • With the remaining five host ID bits, each subnet can have up to 32 host addresses: • 204.17.5.0 255.255.255.224 host address range 1 to 30 • 204.17.5.32 255.255.255.224 host address range 33 to 62 • 204.17.5.64 255.255.255.224 host address range 65 to 94 • 204.17.5.96 255.255.255.224 host address range 97 to 126 • 204.17.5.128 255.255.255.224 host address range 129 to 158 • 204.17.5.160 255.255.255.224 host address range 161 to 190 • 204.17.5.192 255.255.255.224 host address range 193 to 222 • 204.17.5.224 255.255.255.224 host address range 225 to 254

More Related