Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kazi Spring 2008 CSCI 6901 CSCI-690 Computer Networks Khurram Kazi.

Similar presentations

Presentation on theme: "Kazi Spring 2008 CSCI 6901 CSCI-690 Computer Networks Khurram Kazi."— Presentation transcript:

1 Kazi Spring 2008 CSCI 6901 CSCI-690 Computer Networks Khurram Kazi

2 Kazi Spring 2008 CSCI 6902 Major sources of the slides for this lecture  Slides from Tanenbaum’s and William Stallings’ website are used in this lecture

3 Kazi Spring 2008 CSCI 6903 Mankind and Communication  “O mankind! We have created you from a single (pair) of a male and female, and have made you into nations and tribes, so that you may know each other…” [Quran 49.13]  When one ponders over how we get to know each other; certain thoughts come to mind.  As we venture outside our own region or domain, we tend to follow certain protocols that allow us to communicate with each other.  Try to use common language that both parties understand  Sign language  Draw pictures, use hand gestures…  In short we find a command ground or similar footing which to build a communication platform on, even though we may come from diverse cultures and background

4 Kazi Spring 2008 CSCI 6904 Mankind and Communication  Just as we have diversity in mankind, we have disparate, ever-evolving communications networks  These networks are evolving towards providing seamless connectivity between different platforms and applications so that they cater to our insatiable need to communicate  An integral component of networking is PROTOCOLS

5 Kazi Spring 2008 CSCI 6905 TCP/IP Protocol Architecture  developed by US Defense Advanced Research Project Agency (DARPA)  for ARPANET packet switched network  used by the global Internet  protocol suite comprises a large collection of standardized protocols

6 Kazi Spring 2008 CSCI 6906 OSI vs. TCP/IP

7 Kazi Spring 2008 CSCI 6907 OSI vs. TCP/IP  The OSI & TCP/IP reference model.

8 Kazi Spring 2008 CSCI 6908 Reference Models  Protocols and networks in the TCP/IP model initially.

9 Kazi Spring 2008 CSCI 6909 Need For Protocol Architecture  data exchange can involve complex procedures  better if task broken into subtasks  implemented separately in layers in stack  each layer provides functions needed to perform communication for layers above  using functions provided by layers below  peer layers communicate with a protocol

10 Kazi Spring 2008 CSCI 69010 Key Elements of a Protocol  syntax - data format  semantics - control info & error handling  timing - speed matching & sequencing

11 Kazi Spring 2008 CSCI 69011 Simplified Network Architecture

12 Kazi Spring 2008 CSCI 69012 TCP/IP Layers  no official model but a working one  Application layer  Host-to-host, or transport layer  Internet layer  Network access layer  Physical layer

13 Kazi Spring 2008 CSCI 69013 Physical Layer  concerned with physical interface between computer and network  concerned with issues like:  characteristics of transmission medium  signal levels  data rates  other related matters

14 Kazi Spring 2008 CSCI 69014 Network Access Layer  exchange of data between an end system and attached network  concerned with issues like :  destination address provision  invoking specific services like priority  access to & routing data across a network link between two attached systems  allows layers above to ignore link specifics

15 Kazi Spring 2008 CSCI 69015 Internet Layer (IP)  routing functions across multiple networks  for systems attached to different networks  using IP protocol  implemented in end systems and routers  routers connect two networks and relays data between them

16 Kazi Spring 2008 CSCI 69016 Transport Layer (TCP)  common layer shared by all applications  provides reliable delivery of data  in same order as sent  commonly uses TCP

17 Kazi Spring 2008 CSCI 69017 Application Layer  provide support for user applications  need a separate module for each type of application

18 Kazi Spring 2008 CSCI 69018 Operation of TCP and IP

19 Kazi Spring 2008 CSCI 69019 Addressing Requirements (will discuss at length in later lectures)  two levels of addressing required  each host on a subnet needs a unique global network address  its IP address  each application on a (multi-tasking) host needs a unique address within the host  known as a port

20 Kazi Spring 2008 CSCI 69020 Operation of TCP/IP

21 Kazi Spring 2008 CSCI 69021 Transmission Control Protocol ( TCP)  usual transport layer is (TCP)  provides a reliable connection for transfer of data between applications  a TCP segment is the basic protocol unit  TCP tracks segments between entities for duration of each connection

22 Kazi Spring 2008 CSCI 69022 TCP Header

23 Kazi Spring 2008 CSCI 69023 User Datagram Protocol (UDP)  an alternative to TCP  no guaranteed delivery  no preservation of sequence  no protection against duplication  minimum overhead  adds port addressing to IP

24 Kazi Spring 2008 CSCI 69024 UDP Header

25 Kazi Spring 2008 CSCI 69025 IP Header

26 Kazi Spring 2008 CSCI 69026 IPv6 Header

27 Kazi Spring 2008 CSCI 69027 TCP/IP Applications  have a number of standard TCP/IP applications such as  Simple Mail Transfer Protocol (SMTP)  File Transfer Protocol (FTP)  Telnet

28 Kazi Spring 2008 CSCI 69028 Some TCP/IP Protocols

29 Kazi Spring 2008 CSCI 69029 Some TCP/IP Protocols

30 Kazi Spring 2008 CSCI 69030 Network Design: Software & Hardware  Protocol Hierarchies  Design Issues for the Layers  Connection-Oriented and Connectionless Services  Service Primitives  The Relationship of Services to Protocols

31 Kazi Spring 2008 CSCI 69031 Design Issues for the Layers  Addressing  Error Control  Flow Control  Multiplexing  Routing

32 Kazi Spring 2008 CSCI 69032 Connection-Oriented and Connectionless Services  Six different types of service.

33 Kazi Spring 2008 CSCI 69033 Service Primitives  Five service primitives for implementing a simple connection-oriented service.

34 Kazi Spring 2008 CSCI 69034 Service Primitives (2)  Packets sent in a simple client-server interaction on a connection-oriented network.

35 Kazi Spring 2008 CSCI 69035 Reference Network: For discussion purposes

36 Kazi Spring 2008 CSCI 69036 Source of IP Traffic  Application Traffic type could be  FTP (file transfer)  Instant messaging  Secure or non-secure web access  Streaming video  Document sharing (similar to net meeting)  Database access (across the street or across the continent)  Voice over IP  It all boils down to what protocols are used

37 Kazi Spring 2008 CSCI 69037 Summarizing Features of the Protocol Functions  have a small set of functions that form basis of all protocols  Encapsulation (e.g. IP packets encapsulated in Ethernet frames)  fragmentation and reassembly (e.g. fragmentation of a file during an FTP and reassembly of it at the destination)  connection control (e.g. during TCP session)  ordered delivery  flow control  error control  addressing  multiplexing  transmission services

38 Kazi Spring 2008 CSCI 69038 PDUs (Protocol Data Units) and Fragmentation Example: Fragmentation seen during file transfer using FTP This can be an IP Packet This can be a TCP component of the Packet

39 Kazi Spring 2008 CSCI 69039 Fragmentation and Reassembly  Protocol exchanges data between two entities  Lower-level protocols may need to break data up into smaller blocks, called fragmentation  For various reasons  Network only accepts blocks of a certain size  More efficient error control & smaller retransmission units  Fairer access to shared facilities  Smaller buffers  Disadvantages  Smaller buffers  More interrupts & processing time

40 Kazi Spring 2008 CSCI 69040 Starting the protocol stack analysis with The IP Protocol (RFC 791) The IPv4 (Internet Protocol) header.

41 Kazi Spring 2008 CSCI 69041 IP Header Fields continued  Version (4 bits)  (whether the format is of type)  currently IP v4  IP v6  Internet Header Length (IHL) (4 bits)  Is the length of header in 32 bit words,  Points to the beginning of the data (payload)  including options  Minimum value for a correct header is 5

42 Kazi Spring 2008 CSCI 69042 IP Header Fields continued Type of Service (8 bits) (see RFC 791 for details)  Is an indication of the abstract parameters of the Quality of Service (QoS) desired. These parameters are to be used to guide the selection of the actual service parameters when transmitting a datagram through a particular network. Several networks offer service precedence, which somehow treats high precedence traffic as more important than other traffic (generally by accepting only traffic above a certain precedence at time of high load). The major choice is a three way tradeoff between low-delay, high-reliability, and high-throughput. Bits 0-2: Precedence. Bit 3: 0 = Normal Delay, 1 = Low Delay. Bits 4: 0 = Normal Throughput, 1 = High Throughput. Bits 5: 0 = Normal Reliability, 1 = High Reliability. Bit 6 1 = minimize monetary cost [defined in RFC 1349] Bit 7: Reserved for Future Use. Only one of the bits [6:3] can be set to a 1

43 Kazi Spring 2008 CSCI 69043 IP Header Fields continued  Total Length (16 bits)  Total Length is the length of the datagram, measured in octets, including internet header and data. This field allows the length of a datagram to be up to 65,535 octets. Such length of a datagram are impractical for most hosts and networks. Since there is no “end of datagram” character/indicator, network hosts use the datagram length to figure out when the datagram ends and other network data begins.

44 Kazi Spring 2008 CSCI 69044 IP Header Fields continued  Identification (16 bits)  An identifying value assigned by the sender to aid in assembling the fragments of a datagram. It is assigned by the originating host. At the source, there is one-to-one relation between datagrams and datagram identifier. As these datagrams traverse the network, they could be split. Hence this field is used by the receiving host to reassemble the original datagram.

45 Kazi Spring 2008 CSCI 69045 IP Header Fields continued  Flags (3 bits) Bit 0: reserved, must be zero Bit 1: (DF) 0 = May Fragment, 1 = Don't Fragment. Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments.  If the datagram cannot be routed without being fragmented, the router will throw it away and send an error message back to the originating host.  When MF=1, it means that the datagram is one of the two or more fragments, but not the last one of the fragments. Receiving hosts use this flag along with the fragment offset to reassemble the fragmented datagrams.

46 Kazi Spring 2008 CSCI 69046 IP Header Fields continued  Fragment Offset (13 bits)  This field specifies how many units from the start of the original datagram the current datagram is. In other words, the first fragment datagram would have a value of 0 for the offset; if the second datagram starts 100 units from the beginning of the original datagram, the offset would be 100. the unit size is eight bytes (instead of one byte) since the field is only 13 bits wide.

47 Kazi Spring 2008 CSCI 69047 IP Header Fields continued  Time to Live (8 bits)  This field indicated how long the datagram should be allowed to exist after entering the internetwork, measuring in seconds (maximum TTL is 255). Presently as datagrams traverse a router, this number is decremented by one.  This informally represents the maximum number of hops that a datagram can make before being discarded.

48 Kazi Spring 2008 CSCI 69048 IP Header Fields continued  Protocol (8 bits)  This field identifies the next higher layer protocol of the data being carried in the datagram. 01 hexICMP 06 hexTCP 11 hexUDP lists the different protocols and their identifier numbers

49 Kazi Spring 2008 CSCI 69049 IP Header Fields continued  Header Checksum (16 bits)  This field provides error checking on the IP header only, and does not cover the data that is carried at the end of the header. If the header is extended using the options field, then the checksum includes the extended header field too.  If the target IP-addressed interface receives a datagram with a failed checksum, the entire datagram is silently discarded.

50 Kazi Spring 2008 CSCI 69050 IP Header Fields continued  Source IP Address (32 bits)  The sender’s interface’s 32-bit Internet address is identified in four bytes/octets.  e.g.  C0 99 B8 01Four pair of Hex characters   Find the decimal equivalent of the following IP address represented in Hex  0F 10 07 11  ---.---.---.--- ??

51 Kazi Spring 2008 CSCI 69051 IP Header Fields continued  Destination IP Address (32 bits)  The target’s host’s 32-bit Internet address is identified in four bytes/octets.  e.g.  C0 99 B8 03Four pair of Hex characters 

52 Kazi Spring 2008 CSCI 69052 Connectionless Transport with User Datagram Protocol (UDP)  Connectionless protocols have the ability to transmit messages without first establishing a circuit.  The network does not need to do anything except transmit packets to the destination  All error checking and flow control is handled by the sending and receiving applications

53 Kazi Spring 2008 CSCI 69053 Advantages and disadvantages of UDP  Speed  UDP offers speed as it carries short messages between hosts on the same network  Can be used in events where a single packet of data needs to be exchanged between hosts  Reliability  In UDP the data is transmitted “blindly” as opposed to sending the data and waiting for an acknowledgement. This may result in data loss  Only application layer deals with error recovery  Applications can simply turn to the user to send the message again!  Optional checksum

54 Kazi Spring 2008 CSCI 69054 UDP Header

55 Kazi Spring 2008 CSCI 69055 UDP Header  The process layer uses TCP or UDP to pass information to the internetwork layer. It is necessary to identify the client or server tasks uniquely so that the information is passed to the proper service or user task. The identification used in the TCP/IP protocol is called the “Port Number”.  UDP and TCP identify server tasks by using a port number that is consistent and well known. To access a service such as DNS (Domain Name Server), the software knows that DNS is waiting for sessions to be established at port 53.  Client tasks are identified by using port numbers that are variable and temporary, called random port numbers. The client random port numbers exist during the communication process and are discarded when the communication process is complete.

56 Kazi Spring 2008 CSCI 69056 UDP Headers

57 Kazi Spring 2008 CSCI 69057 UDP Headers The term sockets refers to both an API (application program interface) between hos systems and the TCP/IP applications, and a pairing of the IP address and the port number being used. It is also considered the complete network address of an end of the UDP session. In the language of UDP, the sockets in the figure are,53 and,8193 This indicates the client is asking for DNS service

58 Kazi Spring 2008 CSCI 69058 Start of Assignment/mini project 1: To be done in stages!!  Look into network protocol analyzer (and install on your computer) e.g.  Ethereal  Wireshark network Analyzer  Start developing programs that will generate different types of frames/packets and store them in some file (which will be used by the protocol analyzer to deciphering the data contents of the file)  Protocol analyzer will be used for  Deciphering which type of frame/packet was generated  Use personal computer/laptop to access the web for different applications (database access, web browsing, chatting etc.) and capture the packets. Analyze the contents of the packets.  Compare the *.html file with what is seen in the captured packets  What type of protocols yahoo/MSN messenger chatting programs use etc.

59 Kazi Spring 2008 CSCI 69059 Assignment 1, Phase 1.  Write a program that generates 4 IP packets at a time with different IP source and destination addresses.  Use TCP as the client signal of the 2 of IP packets and UDP as the client signal of the other two IP packets  Use to get the protocol numbers for the TCP and UDP. In your program use Hex values for the protocol numbers and not the decimal values.  Use any pattern of your choice (could be random) that populates the payload port of the IP packet, i.e. in our context, data after the TCP or UDP headers.  Keep in mind that payload is part of the UDP or TCP datagram and should be accounted for in their respective headers (Hint: length).  (Defer the calculation of the checksum till we cover it, for now just put some value as a place holder)

60 Kazi Spring 2008 CSCI 69060 Assignment 1, Protocol efficiency analysis  Develop a spreadsheet that analyzes the efficiencies of TCP and UDP protocol  Assume that we have an application that is running under TCP and UDP (separately). This means that the payload portion of the TCP or the UDP will be the application data.  You need to figure out what percentage of the IP datagram has the overhead bytes and what percentage is used for the actual transport of the application data  Draw a graph depicting your results  Use variable packet/datagram sizes in your analysis

Download ppt "Kazi Spring 2008 CSCI 6901 CSCI-690 Computer Networks Khurram Kazi."

Similar presentations

Ads by Google