Blue and Grey

advertisement
TCP/IP
Christopher Zacky
lolwut
Decimal Numbers
Binary Numbers
IP Addresses

IPv4 and IPv6

IPv4 is probably all you've ever seen

IPv4 is a 32-bit address

192.168.1.2

11000000.10101000.00000001.00000010

4,294,967,296 different IPs for IPv4
IPv6


128 bit address
2^128 =
340,282,367,000,000,000,000,000,000,000,000
,000,000 different Ips

IPv6 address looks like this:

2001:0db8:85a3:0000:0000:8a2e:0370:7334
A day in the life of a packet
TCP

Transmission Control Protocol

Guarantees reliable transmission of data

Is a process-to-process communication service

URG, ACK, PSH, RST, SYN, FIN

How a connection is established:

Computer1 sends a SYN

Computer2 sends ACK and SYN

Computer1 sends ACK
Establishing a Connection (TCP 3way handshake)
An Established Connection
TCP Header Breakdown

16 bits – Source Port

16 bits – Destination port

32 bits – Sequence Number

32 bits – Acknowledgment Number

4 bits – Data Offset

6 bits – Reserved

6 bits – Control Bits (URG, ACK, PSH, RST,
SYN, FIN)
TCP Header Continued

16 bits – Window

16 bits – Checksum

16 bits – Urgent Pointer

Then options
TCB

Transmission Control Block

Is created when the connection is created

Is deleted when the connection is closed


Contains the window of packets that are
expected
Packets not in the window are discarded and a
RST packet may be sent
ISN and Duplicate Packets


How do I know if I am receiving duplicate
packets from a previous connection?
ISN is a 32-bit numbers that increments about
every 4 microseconds.

ISN cycles every 4.55 hours

MSL is 2 minutes

A pair of sockets makes a TCP connection
unique
What is TIME_WAIT???

Dat MSL (Maximum Segment Lifetime)

I need to ACK your FIN man
IP





Internet Protocol
Does not guarantee reliable transmission of
data
Doesn't have sequencing
Designed to transmit a packet from a source to
a destination over an interconnected system of
networks
Is called on by host-to-host protocols (like TCP)
IP Header

4 bits – Version

4 bits – IHL (Internet Header Length)

8 bits – Type of Service

16 bits – Total Length

16 bits – Identification

3 bits – Fragment Flags

13 bits – Fragment Offset

8 bits – Time to Live
IP Header Continued

8 bits – Protocol

16 bits – Header Checksum

32 bits – Source Address

32 bits – Destination Address

Then options
Look Familiar?
Download