Internet protocol

Basic protocol of Internet (and intranets).  The Internet Protocol (IP protocol) is a data-oriented protocol used for communicating data across a packet-switched internetwork. IP is a network layer protocol in the internet protocol suite and is encapsulated in a data link layerEthernet). As a lower layer protocol, IP provides the service of communicable unique global addressing amongst computers. No circuit setup is needed before a host tries to send packets to a host it has previously not communicated with (this is the point of a packet-switched network), thus IP (Internet protocol) is a connectionless protocol. This is quite unlike Public Switched Telephone Networks that require the setup of a circuit before a phone call may go through (a connection-oriented protocol).


Two versions currently deployed:

Heterogeneous


IP is implemented on a variety of networks "below"

Unreliable

IP provides an unreliable service (i.e., best effort delivery). This means that the network makes no guarantees about the packet and none, some, or all of the following may apply: In terms of reliability the only thing IP does is ensure the IP packet's header is error-free through the use of a checksum. This has the side-effect of discarding packets with bad headers on the spot, and with no required notification to either end.




Transport protocols

TCP


TCP uses port numbers to identify sending and receiving application end-points on a host

TCP supports many of the Internet's most popular application protocols and resulting applications,

TCP packet


+ Bits 0–3 4–7 8–15 16–31
0 Source Port Destination Port
32 Sequence Number
64 Acknowledgment Number
96 Data Offset Reserved Flags Window
128 Checksum Urgent Pointer
160 Options (optional)
160/192+  
Data
 

TCP/IP packet

+ Bits 0–3 4–7 8–15 16–31
0 Source address
32 Destination address
64 Zeros Protocol TCP length
96 Source Port Destination Port
128 Sequence Number
160 Acknowledgement Number
192 Data Offset Reserved Flags Window
224 Checksum Urgent Pointer
256 Options (optional)
256/288+  
Data
 



UDP



UDP uses port numbers like TCP, and supports application protocols

UDP packet


+ Bits 0 - 15 16 - 31
0 Source Port Destination Port
32 Length Checksum
64  
Data
 

UDP/IP packet


+ Bits 0 - 7 8 - 15 16 - 23 24 - 31
0 Source address
32 Destination address
64 Zeros Protocol UDP length
96 Source Port Destination Port
128 Length Checksum
160  
Data
 

Protocol stacks

The IP stack

The protocols that run on IP networks are often arranged in five layers.

Internet protocol suite
5. Application layer
DHCP • DNS • FTP • HTTP • IMAP4 • IRC • MIME • POP3 • SIP • SMTP • SNMP • SSH • TELNET • TLS/SSL • BGP • RPC • RTP • RTCP • SDP • SOAP • BitTorrent • …
4. Transport layer
TCP • UDP • DCCP • SCTP • …
3. Network layer
IP (IPv4 • IPv6) • ARP • IPSec • ICMP • IGMP • RSVP • IGP • RARP • …
2. Data link layer
ATM • Bluetooth (PAN-Profile) • DTM • Ethernet • FDDI • Frame Relay • GPRS • Modems • PPP • Wi-Fi • …
1. Physical layer
Bluetooth RF • Ethernet physical layer • ISDN • Modems • RS232 • SONET/SDH • USB • Wi-Fi • Power line communication • …

The idea:

Each layer solves a set of problems involving the transmission of data

Upper layers are logically closer to the user and deal with more abstract data.

Lower layers take charge of nitty-gritty of physical transmission.

In practice

It's a bit more messed up than that. E.g.,



The OSI model

OSI Model

Data unit Layer Function
Host
layers
Data Application Network process to application
Presentation Data representation and encryption
Session Interhost communication
Segments Transport End-to-end connections and reliability
Media
layers
Packets Network Path determination and logical addressing (IP)
Frames Data link Physical addressing (MAC & LLC)
Bits Physical Media, signal and binary transmission

The Open Systems Interconnect Basic Reference Model (OSI Model) is also a layered, abstract description for network protocol design, developed by the International Organization for Standardization (ISO).

It adds two layers between "application" and "network" -- which provides a proper space for TLS.










The idea of encapsulation



UDP_encapsulation








Network address translation (NAT)



NAT



Problems of NAT

Benefits of NAT







Network security approaches

At which layer should we provide security?
Quite a difficult question.


Layer
Advantages
Disadvantages
Application

  • Least general, but most flexible
  • Fine-grained security under control of application
  • Can work with proxies and application-layer firewalls
    • proxy simply acts as a server and a client
  • Application specific
  • Only protects payload
    • Traffic analysis possible
Transport
TLS
  • Not transparent to applications, but provides uniform security across applications
  • More fine-grained than IPSec
    • works at transport level
  • Works fine with NAT
  • Only applicable to secure TCP applications
    • Doesn't work with UDP
  • Only protects payload
    • Traffic analysis possible
  • Doesn't work with proxies and application-layer firewalls
    • Designed to resist man-in-middle
    • Web proxies just pass https connections on
Network
IPSec
  • Most general but least flexible
  • Transparent to applications
    • No need to change applications if deploy IPSec on firewall or router
    • No need to train users, issuing/revoking keys on user-basis
  • Flexible policy framework
    • Can provide security for particular apps or particular users
  • Provides routing security
    • authentication or redirects
    • In some modes, source/destination addresses protected as well as the message content
  • Complicated to administrate
  • Designed for IPv6
  • Doesn't work with NAT
    • apparently one of its design goals
  • Doesn't work with proxies and application-layer firewalls
Datalink
Wifi
  • Secures specific link protocols (e.g., wireless)