• No results found

Network Security TCP/IP Refresher

N/A
N/A
Protected

Academic year: 2021

Share "Network Security TCP/IP Refresher"

Copied!
41
0
0

Loading.... (view fulltext now)

Full text

(1)

Network Security – TCP/IP Refresher

(2)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 2

Outline

§

Network Reference Models

§

Local Area Networks

§

Internet Protocol (IP)

§

Internet-level Routing

§

IP Packet Structure

§

Transmission Control Protocol (TCP)

(3)
(4)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 4

Layered view of internetworking example

(5)
(6)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 6

Local Area Networks

§

Devices need to know each other’s layer 2/hardware address (MAC address)

§  6 groups of 2 hex digits: 08:00:27:0E:25:B8

(7)

The Address Resolution Protocol (ARP)

§

If MAC address is not known: Send broadcast ARP request „who has IP address x?“

§

Owner of IP address x answers with (directed) ARP

reply

§

Requestor stores (IP address/MAC address) pair in its ARP cache

§

Cache lifetime: a few/a few 10 seconds (avoiding

frequent ARP requests for the same IP address

(8)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 8

Local Area Networks

ARP

S D

10.0.0.1 10.0.0.2

(9)

Local Area Networks

It’s me! It’s me!

(and this is my MAC addr)

(10)

Network Security HS 2014

(11)

Similarities and differences

§

Switches and routers are network elements, allowing for the extension of physical networks.

§

Switches:

§  Extend Local Area Networks (Ethernet)

§  Operate at layer 2

§  Forward frames, separates collision domains

§

Routers:

§  Interconnect networks

§  Operate at layer 3

§  Forward IP packets

§

Home „routers“ are actually a combination of router,

(12)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 12

Routers interconnect LANs/extended LANs

§

Routers interconnect (sub)networks of the Internet

§

Layer 3 only (IP)

(13)
(14)

Network Security HS 2014

(15)

Internet Protocol

§

IP devices must be addressable via an IP address

§

The IP must be unique on the Internet

§  Public address space (assigned by regional registrars)

§  Private address space (RFC 1918)

-  10.0.0.0-10.255.255.255 -  172.16.0.0-172.31.255.255 -  192.168.0.0-192.168.255.255

§  Reserved address space (special purpose)

(16)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 17

IP Addresses

§

IPv4: a.b.c.d

§  E.g, 10.1.2.3, 208.67.222.222

§  4 “octets” (4x8 = 32 bits)

§  Each octet can go from 0-28-1 or 0 – 255

§

IPv6: a:b:c:d:e:f:g:h

§  2db8:0001:0000:0000:0000:0000:c001:beef

§  2db8:1::c001:beef

§  8 “hextets” (8x16 bits = 128 bits)

(17)
(18)

NSHS08H8353226

(19)
(20)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 21

IP Addresses – Network Address Translation

§

Public IP addresses can be shared among hosts on internal networks.

§

NAT devices keep track of translations that take

(21)
(22)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 23

Routing

§

Devices need a way to find out where in the world a specific IP address is located

§

Routers are connected to other routers through

multiple interfaces

§

Routers keep “routing tables” that list the “next hop” for a list of destinations. If the destination is not on the list, a default hop might be used

§

Routers communicate with each other, informing

(23)
(24)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 25

Internet-level routing

(25)
(26)

NSHS08H8353226

(27)
(28)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 30

Format of an IPv4 packet

Version Header length Type of service Total length

Identification Flags Fragment offset Time to live Protocol Header checksum

Source IP address Destination IP address

IP options (if any) Padding to 32 bits

(29)

Format of an IPv4 packet

Version Header length Type of service Total length

Identification Flags Fragment offset Time to live Protocol Header checksum

Source IP address Destination IP address

IP options (if any) Padding to 32 bits

(30)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 33

Format of an IPv4 packet

Version Header length Type of service Total length

Identification Flags Fragment offset Time to live Protocol Header checksum

Source IP address Destination IP address

IP options (if any) Padding to 32 bits

(31)

Format of an IPv4 packet

Version Header length Type of service Total length

Identification Flags Fragment offset Time to live Protocol Header checksum

Source IP address Destination IP address

IP options (if any) Padding to 32 bits

Payload 32 Bit

TCP UDP

(32)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 36

(33)
(34)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 47

Transmission Control Protocol (TCP)

§

Connection-oriented

§

Error detection and correction (reliable)

§

Full-duplex connection

§

Provides a “byte pipe” §  Unstructured byte stream

§

Sliding window protocol

§

Sequence numbers are byte numbers

§

Sender window is variable, determined by the minimum of

§  Request of the receiver (receiver window size)

§  Estimation of the network load (congestion window size,

(35)
(36)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 49

Conn. setup with 3-way handshake

§

Initial sequence numbers are randomly chosen, within bounds

Last Ack may contain data

(37)
(38)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 51

Basic properties

§

HTTP: Text-based protocol used between web client and web server processes

§

Client issues requests, server sends responses

§

First line of request contains method, object, version:

GET /path/to/file/index.html HTTP/1.0

§

First line of response contains version, code, reason:

HTTP/1.1 200 OK

§

Subsequent lines contain parameters or content

§

HTTP is stateless: Req/Res interaction are

(39)

Methods

Method Description

GET Retrieve document identified by URL

HEAD Same as above, but only return metainformation about the document

POST Send information to server (e.g. form data)

PUT Store a resource under a specified URL (if access rights allow)

DELETE Delete a resource identified by a URL (if access rights allow) TRACE Instructs server to mirror back the client request

CONNECT Used to tunnel through a proxy server

(40)

NSHS08H8353226

ETH Zurich, Bernhard Plattner Network Security HS 2014 53

Codes

Code Type Description

1xx Informational Request received, processing

2xx Success Action successfully received and accepted 3xx Redirection Further action needed to complete request 4xx Client Error Bad request by client

(41)

For probing further

§

Computer Networks: A Systems Approach

Larry L. Peterson and Bruce S. Davie, 4th edition, 2008, Morgan Kaufmann, ISBN: 0-12370-548-7 (hard cover); 0-12374-013-4 (soft cover)

§

Internetworking with TCP/IP, Vol. 1: Principles,

Protocols, and Architecture, Douglas E. Comer,

Prentice Hall International (5th ed., 2005), ISBN: 0-13187-671-6

§

TCP/IP Tutorial and Technical Overview, IBM

References

Related documents

total packet size packet count service application protocol Number destination port source port destination IP address source IP address data session information packet header

Network Layer 4-11 ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier header checksum time to live. 32 bit source IP

Version | Service | Total Length ID | Flags | Fragment TTL | Protocol | IP Checksum Source IP Address Destination IP Address IP Options Source UDP Port Destination

Ethanolamine metabolised by microcompartment mediated metabolism Ethanolamine induced expression of the fim operon (Chapter 5) Potential carbon source in urine Visible BMC in

Lock-in deeds dated 9 March 2015 have been entered into by the Directors, the Locked-in Shareholders, the Selling Shareholder, Eyal Alon and Eyal Rosenblum with each of

In contrast to earlier studies in patients with progressive MS, we found that after a mean follow-up of 3 years, PFS is 100% and furthermore, 81% of our patients had reversal

67 move move yer de yer de  ii  tirmek, ta tirmek, ta  ınmak, ta ınmak, ta  ımak, hareket etmek ımak, hareket etmek 68. 68 notice notice fark etmek,

adaptations of the novels of Austen, Dickens, and Hardy are Shari Denise Hodges’ “Theoretical Approaches to Dickens on Film: The Cinematic Interpretation of Charles Dickens’