DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

36
DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols

Transcript of DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Page 1: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY

TCP/IP Transport and Application protocols

Page 2: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

TCP/IP model

Data unit ISO/OSI Layer

Description DoD Model Layer

Data Application Network processes to applications Application

Presentation Data representation and encryption

Session Interhost communication

Segment Transport End to end connection Transport

Packet Network Logical address and best routing path

Internetwork

Frame Data Link Physical addressing Network Interface

Bit Physical Binary transmission

Page 3: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

TCP and UDPThe two important Transport layer protocols:They help to transfer data from one application

process on one computer to the correct application process on another computer.

TCP (Transmission Control Protocol)Connection-oriented protocol, more reliable and

slower.UDP (User Datagram Protocol)Connection-less, faster, simpler and not reliable

(no error checking).

Page 4: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

TCP and UDP comparison

Features TCP UDP

Flow control and windowing Yes No

Connection-oriented Yes No

Error recovery Yes No

Segmentation and reassembly of data Yes No

In-order delivery of data Yes No

Identifying application using port numbers

Yes Yes

Page 5: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

To use TCP or UDP (optional)

Protocol Application

TCP FTP data

TCP FTP Control

TCP Telnet

TCP SMTP

TCP, UDP DNS

UDP TFTP

TCP HTTP (web)

TCP POP3

UDP SNMP

UDP RIP

Page 6: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Flow Control

Receiver needs time to process data and inform sender how fast the data could be sent to it. Two methods to control flow:

*Dynamic sliding windows

**Withholding acknowledgments

Page 7: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Dynamic Sliding Windows

1. Receiver advises window (size of data limit)

2. Sender keeps sending data until the limit. Stop and wait for ACK.

3. Receiver processed data and sent ACK and next window value to sender.

4. Sender starts sending data until reach the limit. Then, wait for ACK and next window value.

Page 8: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Withholding Acknowledgments

Another option of receiver is wait to send ACK.

1. Receiver informs sender the window size.

2. Sender keeps sending data until limit of window.

3. Receiver only sends out ACK after complete the processing

4. Sender receives ACK and window size and starts next round sending.

Page 9: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Window

The max value of data sender can send before an acknowledgment.

Page 10: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

TCP Three way handshake

1. First segment has a SYN flag but does not have the ACK flag set. (SYN=1 and ACK=0)

2. The second has both SYN and ACK set

3. The third and ongoing segment have only ACK

Page 11: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

TCP error recovery (reliability)

TCP acknowledges the receipt of data by the Acknowledgment Number filed of the TCP header.

It identifies the next byte expected to be received. NOT the last byte received.

Sender 1000 1002 1003 Receiver

Sender 1001 Receiver (because received 1000)

Page 12: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Segmentation

TCP received data from application protocols and break them into small pieces for transmission. TCP header is put in front of each chunk.

Maximum Segment Size (MSS) : max length of TCP data filed. Ethernet frames allow 1500 data bytes in data field. TCP and IP header are 20 bytes each. 1460 is the MSS in Ethernet

Page 13: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Reassembly and in-order delivery

In-order delivery: Sent by sequence.

Reassembly: according to the SEQ number. Receiver may temporary store segments into memory and wait for other segments for reassembly by sequence.

Page 14: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

TCP and UDP header

TCP header

UDP header

2 bits 2 4 4 4 6 6 2 2 2 3 1

Source port

Dest. Port

Seq Number

Ack Number

Offset Reserved Flags Window Size

Check sum

Urgent Options PAD

2 2 2 2

Source Port

Dest Port Length Checksum

Page 15: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Port number

Application may use multiple port numbers in the same time. A unique port number is needed for each TCP or UDP connection.

Such port numbers are dynamic port number. A host can dynamic allocate 1024 (2^10) to 65,535 (2^16) port numbers

Page 16: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Uses of port number

Type of port Range of port number value

Purpose

Dynamic 49,152-65,535

Allocated by client for each new application process

Well-known 0-1023 For high privilege processes, used so that all clients know the correct port number

Registered 1024-49,151 Equivalent to Well-known port, but for nonprivileged application process.

Page 17: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Well-known ports

Port number Protocol Application

20 TCP FTP data

21 TCP FTP Control

23 TCP Telnet

25 TCP SMTP

53 TCP, UDP DNS

69 UDP TFTP

80 TCP HTTP (web)

110 TCP POP3

161 UDP SNMP

520 UDP RIP

Page 18: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Application layer

In DoD model, application layer, application protocols define the format of the data being transferred (such as binary or ASCII text); encryption and the rules for transferring data.

In ISO/OSI model, application layer is only responsible for application interface. Encryption is in Presentation layer which is also responsible for data representation. Session layer is to combine message communication between hosts.

Page 19: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

DNS (Domain Name Service)

Tranlate between Full Qualified Domain Name and IP address.

Domain name is in human language such as www.cisco.com and IP address is in the numbering format.

Top level domain could be in 3 categories:1. Tradition: .com, .net, .edu, .gov, .mil, .org2. Country code: ck, uk, jp, pl, ru, etc, etc.3. New released: .info, .aero, .museum, .name,

.coop, .biz, .pro.

Page 20: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

HTTP (Hypertext Transfer Protocol)

Application layer protocolDistribute, collaborate and retrieve inter-linked resource from

web pagesDefault port is 80 (*could use different port)Typical requests: Head: asks for the meta-information Get: requests a representation of the specified resource.Post: submit data to be processedPut: Uploads a representation of the specified resource.Delete: Deletes the specified resource.Trace: echoes back the received requestOptions: returns the HTTP methods that the server supports for

specified URL

Page 21: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

HTTPS (Hypertext Transfer Protocol Secure) (Optional)

HTTPS is a combination of the HTTP and a network security protocol

HTTPS has also been known as "Hypertext Transfer Protocol over Secure Socket Layer", but now HTTPS may be secured by the Transport Layer Security (TLS) instead of Secure Sockets Layer (SSL) protocol.

An https: URL may specify a TCP port. If it does not, the connection uses port 443 (unsecured HTTP typically uses port 80)

Page 22: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

HTML, DHTML and XML (Optional)

HTML (HyperText Markup Language): the predominant markup language for Web pages.

DHTML (Dynamic HyperText Markup Language): is a collection of technologies used together to create interactive and animated web sites by using a combination of a static markup language (such as HTML), a client-side scripting language (such as JavaScript), a presentation definition language (such as CSS), and the Document Object Model.

XML (Extensible Markup Language): is a general-purpose specification for creating custom markup languages. It can perfectly present shared structured data.

Page 23: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Sample code of HTML (optional)

Sample html code:<!DOCTYPE html> <html> <head> <title>Title bar display</title> </head> <body> <p>Hello This is my page!!</p> </body> </html>

Page 24: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Web server (optional)

The web server is toHost web pagesAnswer HTTP requestsLogging clients visitsOffer authentication if it is requiredBandwidth throttlingCould be running on Windows IIS or

Unix/Linux system

Page 25: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Web client and browser (optional)

Web clients are using browser to display and interact with text, images, videos, music, games and other information typically located on a Web page at a Web site on the World Wide Web or a local area network.

Typical browsers: Internet Explorer, Opera,Mozilla Firefox,Safari,Avant BrowserMaxthon,AOL Explorer

Page 26: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

E-Mail protocols: SMTP, POP3 and IMAP

SMTP (Simple Mail Transfer Protocol) is an Internet standard for electronic mail (e-mail) transmission across Internet Protocol (IP) networks.

POP3 (Post Office Protocol version 3) is an application-layer Internet standard protocol used by local e-mail clients to retrieve e-mail from a remote server over a TCP/IP connection.

Internet Message Access Protocol (commonly known as IMAP or IMAP4, and previously called Internet Mail Access Protocol, Interactive Mail Access Protocol and Interim Mail Access Protocol is an application layer Internet protocol operating on port 143 that allows a local client to access e-mail on a remote server.

Page 27: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Email access (optional)

Web mail (hotmail, yahoo, gmail, and exchange web access)

OutlookOutlook expressTelnet Blackberry (BIS and BES)Many freeware: courier, Eudora, Foxmail,

Opera Mail, Window Live Mail, etc, etc.

Page 28: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

telnet smtp.example.com 25 (optional) S: 220 smtp.example.com ESMTP Postfix C: HELO relay.example.org S: 250 Hello relay.example.org, I am glad to meet you C: MAIL FROM:<[email protected]> S: 250 Ok C: RCPT TO:<[email protected]> S: 250 Ok C: DATA S: 354 End data with <CR><LF>.<CR><LF> C: From: "Bob Example" <[email protected]> C: To: Alice Example <[email protected]> C: Date: Tue, 15 Jan 2008 16:02:43 -0500 C: Subject: Test message C: C: Hello Alice. C: This is a test message with 5 headers and 4 lines in the body. C: Your friend, C: Bob C: . S: 250 Ok: queued as 12345 C: QUIT S: 221 Bye {The server closes the connection}

Page 29: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

File transfer application protocols

HTML can also be used to transfer filesTFTP: is faster and using UDP port 69FTP: support authentication and using TCP

port 20 and 21FTP (TFTP) server hosts the files and

documents in a structured directory tree.Client uses various programs to get, upload files

and documents. The programs could be SmartFTP, FileZilla, CuteFTP, WISE-FTP, etc, etc.

Page 30: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Telnet

Telnet is a network protocol used on the Internet or local area networks

The term telnet also refers to software which implements the client part of the protocol. Telnet clients are available for virtually all computer platforms. (Start Run “cmd” telnet /?)

The client-server protocol is using TCP port 23 by default. And it does not encrypt any data sent over the connection (including the password). Thus, all information can be captured by network sniffer.

Page 31: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

SSH (optional)

Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices.

SSH was designed as a replacement for TELNET which is an insecure remote shells and transfer password in clear text format.

Page 32: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

SNMP (Simple Network Management Protocol)

An SNMP-managed network consists of three key components:

Managed devices (a computer or a network host such as router and switch)

Agents (software running in the managed devices)

Network-management station (central management work station in which application server is executed)

It is possible to configure a Cisco router as a SNMP server

Page 33: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

What is the Network address of 172.16.132.70/20?

Page 34: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Another Example of Network Address172.16.4.35/27

Host Address 172. 16. 4. 35

Binary Host

Address10101100 00010000 00000100 00100011

Binary Subnet

Mask11111111 11111111 11111111 11100000

Binary Network

Address

10101100 00010000 00000100 0010000

Network Address 172. 16. 4. 32

Page 35: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Private IP addressJust to remember

Thus, it is possible for many companies / organizations using same network address internally. (For instance, 10.10.10.10 could be used for computer Tom in company Apple and by computer Jerry in company Boss) But, again, the potential duplicated addresses are used internally.

Certain blocks are reserves as private IP address used in company / organization internal networks. More computers could have “unique” IP address in IPV4.

Class Range of IP address

Range of Network number

Default network mask

Total number of networks

A 10.0.0.0 – 10.255.255.255

10.0.0.0 – 10.0.0.0

/8 (255.0.0.0) 1

B 172.16.0.0 – 172.31.255.255

172.16.0.0 – 172.31.255.255

/12 (255.240.0.0)

16

C 192.168.0.0 – 192.168.255.255

192.168.0.0 – 192.168.255.255

/16 (255.255.0.0)

256

Page 36: DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols.

Class B table# of bit borrowed

Subnet Mask # of Usable

Subnets

# of available Hosts

.11000000.00000000 255.255.192.0 4 16,382

.11100000.00000000 255.255.224.0 8 8,190

.11110000.00000000 255.255.240.0 16 4,094

.11111000.00000000 255.255.248.0 32 2046

.11111100.00000000 255.255.252.0 64 1022

.11111110.00000000 255.255.254.0 128 510

.11111111.00000000 255.255.255.0 256 254

.11111111.10000000 255.255.255.128 512 126

.11111111.11000000 255.255.255.192 1024 62

.11111111.11100000 255.255.255.224 2048 30

.11111111.11110000 255.255.255.240 4096 14

.11111111.11111000 255.255.255.248 8192 6

.11111111.11111100 255.255.255.252 16384 2