Vaguely Related to ETC

Transport and Application: Master Post

Process To Process Communication

Key Points

Transport layer ensured that the whole message is relieved intact and in the right order also checking for error control and flow control.

This means that transport layer is responsible for delivery of a message from one process to another.

This is because computers often run several processes at the same time, so just delivering the datagram to computer is not enough but it has to be handed over to the right process

References

​Behrouz A. Foruzan, ​“Data Communication and Networking”​, ​Tata McGraw-Hill​, ​(4th Edition). (703-705)

A process is an application program running on a host. It doesn’t care a lot about any relationship between each packet, it treats each packet individually. Transport layer ensured that the whole message is relieved intact and in the right order also checking for error control and flow control.

This is because computers often run several processes at the same time, so just delivering the datagram to computer is not enough but it has to be handed over to the right process. This generally means delivering it to the right port as separate processes are running on each port.

LayerFunction
Data Link node to node
Network Layerhost to host
Transport Layerprocess to process

Client/Server Paradigm

  • Process on local host called client needs services from a process on remote host called server

Addressing

Key Points

Port numbers are 16-bit integers between 0-65535 and the client program defines itself with the port number chosen randomly by the transport layer.

o Registered ports. The ports ranging from 1024 to 49,151 are not assigned or con- trolled by lANA. They can only be registered with lANA to prevent duplication.

o Well-known ports. The ports ranging from 0 to 1023 are assigned and controlled by lANA. These are the well-known ports.

o Dynamic ports. The ports ranging from 49,152 to 65,535 are neither controlled nor registered. They can be used by any process. These are the ephemeral ports.

Combination of IP address and the port number is called a socket address

References

​Behrouz A. Foruzan, ​“Data Communication and Networking”​, ​Tata McGraw-Hill​, ​(4th Edition). (703-705)

Google Dictionary for Port origin

At transport layer we use port address — question does port come from transport?

Origin

Old English, from Latin portus ‘haven, harbour’, reinforced in Middle English by Old French.

Eh, nvm. I was wrong!

Port numbers are 16-bit integers between 0-65535 and the client program defines itself with the port number chosen randomly by the transport layer.

IANA Ranges

Internet Assigned Number Authority divided the ranges into three segments.

Port NumbersFunction
0-1023Well-known ports
1024-49151Registered Ports
49151-65535Dynamic Ports

Socket Addresses

Process to process delivery needs two identifiers, one if IP address and second is port number. Combination of IP address and a port number is called a socket address.

200.23.78.8:69 -> Socket Address

Multiplexing and Demultiplexing

Multiplexing
At the sender site, there may be several processes that need to send packets. However, there is only one transport layer protocol at any time. This is a many-to-one relationship and requires multiplexing. The protocol accepts messages from different processes, differentiated by their assigned port numbers. After adding the header, the transport layer passes the packet to the network layer.
Demultiplexing
At the receiver site, the relationship is one-to-many and requires demultiplexing. The transport layer receives datagrams from the network layer. After error checking and dropping of the header, the transport layer delivers each message to the appropriate process based on the port number.

Behrouz A. Foruzan, ​“Data Communication and Networking”​, ​Tata McGraw-Hill​, ​(4th Edition). (pg. 707)

Transport Layer Protocols : UDP/TCP/SCTP

Key Points

UDP is connectionless, unreliable transport protocol but we DNS still 💙 it because it’s simple. It also happens to provide very limited error checking and often feels inferior to TCP because everyone associated TCP with IP by saying TCP/IP

Sending small messages with TCP takes very few interactions

TCP is more realiable and creates a connection between the two processes. The connection is made using 3-way-handshake(SYN, SYN+ACK, ACK), the the data is transfered using data-trasfer(ACK+Data) and teardown(FIN, FIN+ACK, ACK)

A connectionless transport layer treats each segment as an independent packet and delivers it to the transport layer at the destination machine. A connection-oriented transport layer makes a connection with the transport layer at the destination machine first before delivering the packets.

TCP is Connection-oritneted transport layer protocol where as UDP is connection oriented

TCP creates a relationship between segments using sequence numbers

References

​Behrouz A. Foruzan, ​“Data Communication and Networking”​, ​Tata McGraw-Hill​, ​(4th Edition). (703-705)

https://lagunita.stanford.edu/courses/Engineering/Networking-SP/SelfPaced/course/ Unit 2

UDP : User Datagram Protocol

Applications that don’t need garuntee from the service. It takes application data and creates a UDP datagram.

UDP data is encapsulated in IP datagram.

0-1516-31
Source PortDestination Port
ChecksumTotal Length (bytes)

Fields used for UDP checksun contain IPv4 Checksum too.

Provides simple application protocol. UDP is demultiplexing mechanism

PropertyBehavior
Connectionless Datagram ServiceNo connection establised. Packets may show up in any order
Self contained datagrams
Unrealiable Delivery1. No acknowledgments
2. No mechanism to detect missing or mis-sequenced datagrams
3. No flow control.

Realtime audio and video services used to use UDP, provided simpler

Port ProtocolDescription
7EchoEchoes a received datagram back to the sener
13DaytimeReturns the date and the time
17QuoteReturns a quote of the day
19ChargenReturns a string of characters
20, 21FTPFile Transfer protocol
23TELNETTerminal Network
53NameserverDomain Name Service
67BOOTPsServer port to download bootstrap information
68BOOTPcClient port to download bootstrap information
69TFTPTrivial File Transfer Protocol
80HTTPHypertext Transfer Protocol
IIIRPCRemote Procedure Call
123NTPNetwork Time Protocol
161SNMPSimple Network Management Protocol
162SNMPSimple Network Management Protocol (trap)

Used for DNS- Domain Name Server

UDP Checksum

Checksum is sum of UDP = 32bit source IP address +32bit destination IP address+ (ALiOs, 8-bit-protocol, 16 bit UDP total length) + (source port add, destination port add)

There is no flow/error control in UDP.

TCP is reliable compared to it’s UDP counterpart. When two channels are trying to communicate with TCP they establish a two way communication channel between them.

This is called communication and there is a statemachine at the end ot this two way channel

Connection Setup : 3 Way Handshake

  • A sends message syn to B
  • B reponds with syn+ack
  • A responds with an ack

The data is sent in continuous stream of bytes. A takes stream of byte and put in TCP segment then gives it to IP layer to send it to be.

Behrouz A. Foruzan, ​“Data Communication and Networking”​, ​Tata McGraw-Hill​, ​(4th Edition). 717

Connection Teardown

  • A send fin message to B
  • B send data + ack
PropertyBehaviour
Stream of bytesReliable byte delivery service
Reliable delivery 1. Ack indicate correct delivery
2. Checksum for detecting corrupted data
3. Sequence numbers to detect missing data
4. Flow-control prevents overrruning reciver
In-SequenceData Delivered to application in sequence tranmitted
Congetion Control Controls network congestion
Reference

mnemonics : Should Dean Scold All Hundred Righteous Folks, We Could Urgently Take Them Down

Unskilled Attacker Pester Real Security Folks

Unskilled = URG
Attackers = ACK
Pester = PSH
Real = RST
Security = SYN
Folks = FIN

https://danielmiessler.com/study/tcpflags/

The unique ID of TCP connection

  • A TCP connection is uniquely identified by five pieces of information in the TCP and IP headers.
  • The IP source and destination addresses uniquely identify the end points, and the IP Protocol ID for TCP tells us the connection is TCP.
  • The TCP source and destination ports identify they application processes on the end hosts. Together, at any instant, all
  • 5 fields uniquely identify the TCP connection Internet-wide.

Full-Duplex Communication
TCP offers full-duplex service, in which data can flow in both directions at the same time. Each TCP then has a sending and receiving buffer, and segments move in both directions.

Behrouz A. Foruzan, ​“Data Communication and Networking”​, ​Tata McGraw-Hill​, ​(4th Edition). 718

TCP features

  • Numbering System – Sequence number and the acknowledgment number refer to the byte number
    • Byte Number TCP numbers all data bytes that are transmitted in a connection
    • Sequence Number After the bytes have been numbered, TCP assigns a sequence number to each segment that is being sent. The sequence number for each segment is the number of the first byte carried in that segment.
  • Flow control
  • Error Control
  • Congestion Control

Leave a Reply

%d bloggers like this: