You are on page 1of 24

TCP/IP

Pedro Rato
M3632
Networked Systems Administration
Fall 2016

History of TCP/IP
1973 - First definition of the concept for the TCP
1974 - Specification of the Internetwork Transmisson Control Protocol in the RFC 675
1978 - Separation into two protocol stacks
- TCP -> RFC 760
- IP -> RFC 761

OSI model

Network Encapsulation

IPv6
-

Larger address space -> 128 bits address


Simplified Header
End-to-end - every single device has a unique IPv6
Auto-configuration - stateful and stateless configuration mode
Anycast - no broadcast support, supports unicast and multicast
Mobility - allows a machine to change its location without changing IP
Enhanced Priority support - traffic class and Flow label are used enhance routing
Transition mechanisms
-

Dual IP stack
Tunneling from 6 to 4 and back
NAT

- IPsec - re-engineered for IPv4

IPv6
- An IPv6 address is composed of 128 bits divided into eight 16 bit blocks
converted into Hexadecimal
-

2001:0000:3238:DFE1:0063:0000:0000:FEFB

- The header as a fixed Header and zero or more optionals with the essential
information for routing being in the fixed section
- The header can be as large as the full packet

IPv6 Header
- Version 4 bits
- Traffic class 8 bits, 6 for type of service and 2 for explicit congestion notification
ECN
- Flow Label 20 bits maintains the sequential flow
- Payload Lenght 16 bits
- Next header 8 bits indicates the type of the extension header or the Upper layer
PDU
- Hop limit 8 bits
- Source Address 128 bits
- Destination Address 128 bits

IPv4
- 32 bits address divided by 4 octets with the higher value of each being 255 in
decimal the octets represent the network , sub-network and host
-

- 255.255.255.255

- To distinguish each part the routers use a subnet mask that permits the
calculation of each part

IPv4 Private and Public


Shortage of available IPv4 addresses motivated the development of a scheme that
turned some IPs private and they are translated by the Network Address Translation
(NAT) into private and vice versa, there intent is to allow allocation of address freely
within an organization or home. NAT also permits hiding the specific address and
addressing structure of the internal network.
Class A

10.x.x.x /8

Class B

172.16.x.x /12

Class C

192.168.x.x /24

IPv4 Header

IPv4 Header
-

IP version
IP header length
Type of service - how the packet is handled
Total Length
Identification - unique ID
Flags 3Bits - 1st fragmentation 2nd is last packet

IPv4 Header
- Fragment Offset - order in series of packets
- Time to live (TTL) - decrements in every hop the packets makes, avoiding that
the packet wonders forever
- Protocol - Indicates the upper protocol
- Header checksum - ensures the headers integrity
- Source Address
- Destination Address

TCP Header Format

TCP header
-

Source Port 16 bits


Destination port 16 bits
Sequence number 32 bits
Ack number 32 bits
Header length 4 bits
Reserved 6 bits
Flags 6 bits
Receiver Window size 16 bits
Urgent pointer 16 bits
Options variable

TCP
- Connection oriented
- Reliable - all packets are sequenced and acknowledged (ACK)
- End-to-end semantic
- Full-duplex
- Hardware independent
- Vendor independent

TCP Basic Applications


-Email(SMTP)
-Web browsing(HTTP)
-File Transfer(FTP)
-Virtual Terminal Protocol(TELNET)
-Secure Shell (SSH)
-Other applications can be built on top of these applications

Performance metrics
-Round trip delay: the time needed to travel to a destination and back to the
source
-One way delay: the time needed to travel to a destination from the source or
from the destination to the source.
-Maximum delay: Maximum tolerable delay.
-Delay variation (or jitter): Variation in delay for individual packets.
-Packet loss rate: ratio of the number of packets lost or corrupted to the total
number of packets transmitted

Performance metrics
-Bandwidth: Application bytes transferred in seconds.
-Throughput variation: variability in the received bandwidth over a given time
scale.
-File transfer time: Time takes to transfer a file/object on the WWW
-Fairness: Long-term/short-term fairness among all TCP/UDP flows.
-Resource consumption: amount of resources consumed.

TCP Congestion Control


- Prevent buffer overflow at routers
- Regulate sending rate as TCP sender
- Mechanism
-

Slow-start
Congestion avoidance
Additive Increase, Multiplicative Decrease (AIMD)

TCP Flow control


- Prevent Buffer overflow at TCP reciver
- Regulate sending rate as TCP sender
- Mechanism
-

Sliding window

Packet flow
- Mac Address - Media access control address is the 48 bit physical address of the
network interface
- Address resolution protocol - is a packet that is broadcasted to all the network but
only the receiver answers providing its MAC address
- Proxy server - acts as intermediary with the host and the destination server
- Dynamic Host Control Protocol - attributes an IP from a pre-defined pool, it also
provides information such as Gateway IP, DNS Server Address, lease time to IP
- DNS - translate human readable address into an IP address
- NAT - translation of private IPs to public and vice versa

Linux commands
-

ifconfig - getting network configuration


hostname - finding host/domain name and IP address
netstat - network connections, routing tables, interface statistics
nslookup - query DNS lookup name
telnet - communicate with another hostname
traceroute - trace of the steps a packet makes to reach destination
finger - view user information
ping - test network connection
whois - learn more about a domain
nc - netcat is a powerful command that allows us to do things like listen to TCP or
UDP ports, port scanning, open TCP connections.

Tools
- Wireshark - free and open source packet analyzer

Packet Tracer - network simulator

- Snort - real-time traffic analysis and packet logging

References
-

RFC 760, RFC 761, RFC 675


High performance TCP/IP Networking, Hassan-Jain, Prentice Hall
http://www.tutorialpoint.com/
http://www.tecmint.com/ip-command-examples/
https://www.cyberciti.biz/tips/linux-investigate-sockets-network-connections.html
http://books.gigatux.nl/mirror/snortids/0596006616/snortids-PREFACE-2-SECT-7.
html

You might also like