27
1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

Embed Size (px)

Citation preview

Page 1: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

1

LAN Protocols

(Week 3, Wednesday 9/10/2003)

© Abdou Illia, Fall 2003

Page 2: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

2

Learning Objectives

Explain how the most used LAN protocols work.

TCP UDP IP

Page 3: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

3

What is a protocol ? Set of rules that govern data communication

over a network

Examples of protocols: Transmission Control Protocol (TCP), Internet

Protocol (IP), Simple Mail Transfer Protocol (SMTP)

Examples of protocol suites: TCP/IP IPX/SPX NetBEUI

Page 4: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

4

Protocols in Windows 98Figure 2.14: Network Dialog Box in Windows 98

Properties Button

Network Dialog box in Windows 98

Page 5: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

5

TCP/IP protocol suite

A suite of protocols rather than a protocol Protocol suite that govern data communication

on the Internet Designed for use with wide range of network

devices Main protocol of most computer operating

systems Many troubleshooting and network analysis tools Understood by a large body of network

professionals

Page 6: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

6continued…

Page 7: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

7

Page 8: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

8

DL-TDL-T

TCP/IP and Layered Communications

ApplicationApplication

TransportTransport

InternetInternet

Data LinkData Link

HTTP req.HTTP req.

PhysicalUser PC

HTTP req.HTTP req. TCP-HTCP-H

HTTP req.HTTP req. TCP-HTCP-H IP-HIP-H

HTTP req.HTTP req. TCP-HTCP-H IP-HIP-H DL-HDL-H

Q1: What are Transport layer messages called when TCP is used?Q2: What are Transport layer messages called when UDP is used?

Page 9: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

9

How TCP Works

Establishes communication sessions between networked computers

Provides reliable end-to-end delivery of data by controlling data flowSequencing and acknowledging frames

Page 10: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

10

TCP

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

Sequence Number (32 bits)

Acknowledgment Number (32 bits)

Window Size(16 bits)

Header Length(4 bits)

Reserved(6 bits)

Flag Fields(6 bits)

Options (if any)

TCP Checksum (16 bits) Urgent Pointer (16 bits)

Padding

Data Field

Bit 0 Bit 31

Flag fields are one-bit fields. They include SYN, ACK, FIN and RST.

TCP Segment

Page 11: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

11

TCP Segment Source Port Number and Dest. Port Number: Well-Known port number for

server applications (See slide # 27) or Ephemeral port number (>1024 and < 65535) for client PC applications.

Sequence Number: 32-bit sequential number for the frame. Enables TCP to ensure that all frames are received. Used to place frames back in correct order.

Acknowledgement Number: Number sent in ACK message to acknowledge frame reception. If ACK message not sent for a frame, frame is retransmitted.

Header Length (Offset): Indicates the length of the header. Flag Fields: Used to identify the kind of TCP segment: SYN (Synchronization)

for opening a connection, ACK (Acknowledgement) to acknowledge frame reception, FIN to close a connection. Used for control: RST (Reset) for an abrupt close, FLW (Flow control) to control transmission flow.

Window Size: Indicates number of bytes to be transmitted before sender receives an ACK of receipt. When Window Size is reached Flow control is turned on to stop transmission until ACK is received.

Checksum: 16-bit cyclic redundancy check computed based on values in all fields and placed in the frame by sending node.

Page 12: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

12

TCP Segment Urgent Pointer: Provides a warning to the receiver that urgent data is

coming. Also points to the end of the urgent data in the sequence. Options: Can hold additional information and flags about a transmission. Padding : Used when there is too little or no optional data to complete the

required header length, which must be divisible by 32.

Page 13: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

13

TCP Time Diagram

PCTransport Process

WebserverTransport Process

1. SYN (Open)

2. SYN, ACK (1) (Acknowledgement of 1)

3. ACK (2)

Open

3-Way OpenTCP is a Connection-Oriented Protocol

Page 14: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

14

TCP Time Diagram

Acknowledgements

Each correct TCP segment is acknowledged (ACK), except for pure acknowledgements and resets

Sender listens to be sure that each TCP segment is acknowledged

If a segment is not acknowledged in a reasonable period of time, the sender resends it

TCP is a reliable protocol

Page 15: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

15

TCP Time Diagram

PCTransport Process

WebserverTransport Process

1. SYN (Open)

2. SYN, ACK (1) (Acknowledgement of 1)

3. ACK (2)

4. Data = HTTP Request

5. ACK (4)

6. Data = HTTP Response

7. ACK (6)

Open(3)

CarryHTTPReq &Resp

(4)

After Opening, Data are Transferred

Page 16: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

16

TCP Time Diagram

PCTransport Process

WebserverTransport Process

8. Data = HTTP Request (Error)

9. Data = HTTP Request (No ACK so Retransmit)

10. ACK (9)

11. Data = HTTP Response

CarryHTTPReq &Resp

(4)

After Opening, Data are Transferred

11. ACK (11)

Q3: Is TCP a reliable protocol ? Why?

Q4: If there is an error in the transmission, which Transport process retransmits the damaged segment?

Page 17: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

17

TCP Time Diagram

PCTransport Process

WebserverTransport Process

12. FIN (Close)

13. ACK (12)

14. FIN

15. ACK (14)

Close(4)

4-Way Close is Normal

Page 18: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

18

UDP Connectionless alternative to TCP that

yields a lower overhead, but is less reliableRelies only on checksum to ensure reliability

Handles and transmits data faster; performs no flow control, sequencing, or acknowledgment

Page 19: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

19

UDP Datagrams

Sequence Port Number (16 bits) Destination Port Number (16 bits)

UDP Length (16 bits) UDP Checksum (16 bits)

Data Field

Bit 0 Bit 31UDP Datagram

Page 20: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

20

UDP Datagram

PCTransport Process

WebserverTransport Process

UDP Datagram

Connectionless and UnreliablePlaces a Lighter Load on the Network than TCP

Useful Where the Loss of an OccasionalApplication Message is Not a Serious Problem

As in Regular Network Status Messages

Or Where There is No Time for Retransmission,As in Voice Transmission

Page 21: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

21

TCP Versus UDP

TCP UDP

Layer

Message name

Processing powerrequired

Reliability

Connections?

Transport Transport

TCP segment UDP datagram

Reliable Unreliable

Connection-oriented Connectionless

Heavyweight Lightweight

Page 22: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

22

IP

Enables packets to reach a destination on a local or remote network by using IP addresses

Used in combination with TCP or UDP

Page 23: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

23

IP

Total Length(16 bits)

Identification (16 bits)

Header Checksum (16 bits)Time to Live

(8 bits)

Flags

Protocol (8 bits)1=ICMP, 6=TCP,

17=TCP

Bit 0 Bit 31IP Version 4 Packet

Source IP Address (32 bits)

Fragment Offset (13 bits)

Type of Service(8 bits)

HeaderLength(4 bits)

Version(4 bits)

Destination IP Address (32 bits)

Options (if any) Padding

Data Field

0100

Page 24: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

24

IPv4 Packets

VersionHas value of four (0100)

Time to Live (TTL)Value is set by senderDecremented by one by each router along the

way If reaches zero, router throws packet awayPrevents the endless circulation of mis-

addressed packets

Page 25: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

25

IPv4 Packets

Protocol Identifies contents of data field1 = ICMP6 = TCP17 =UDP

Address Fields32 bits long, of course

IPHeader

Data FieldICMP, TCP, or UDP Message

Page 26: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

26

Other slide

Page 27: 1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003

27

Port NumbersPort Number Application (Service)

20 File Transfer (FTP)

23 Telnet applications (Telnet)

25 E-mail (SMTP)

53 DNS server applications

80 Webservice (HTTP)

139 NetBIOS applications

Client PC172.171.18.22

Webserver172.168.17.13

Port 80

SMTP Server172.30.17.13

Port 25

From EphemeralPort 20247

To Well-KnownPort 80From 172.171.18.22:20247

To: 172.168.17.13:80

From 172.168.17.13:80To: 128.172.18.22:20247

From 172.171.18.22:19345To: 1172.30.17.13:25