An Experiment in Implementing a Stateless TCP DNS Server Geoff Huston APNIC.

Slides:



Advertisements
Similar presentations
Dateless and Desperate ! Geoff Huston APNIC Stateless DNS.
Advertisements

Transport Layer3-1 Transport Overview and UDP. Transport Layer3-2 Goals r Understand transport services m Multiplexing and Demultiplexing m Reliable data.
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
Laboratório de Teleprocessamento e Redes1 Unix Network Programming Prof. Nelson Fonseca
Camarillo / Schulzrinne / Kantola November 26th, 2001 SIP over SCTP performance analysis
CISCO NETWORKING ACADEMY Chabot College ELEC Transport Layer (4)
CCNA – Network Fundamentals
Chapter 7: Transport Layer
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 7: Transport Layer Introduction to Networking.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 7: Transport Layer Introduction to Networking.
Lecture 7 Transport Layer
Chapter 7 Intro to Routing & Switching.  Upon completion of this chapter, you should be able to:  Explain the need for the transport layer.  Identify.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
Chapter 7 – Transport Layer Protocols
Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup.
A Question of Protocol Geoff Huston APNIC. Originally there was RFC791:
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Chapter 3: Transport Layer
William Stallings Data and Computer Communications 7 th Edition (Selected slides used for lectures at Bina Nusantara University) Transport Layer.
TCP/IP Protocol Suite 1 Chapter 11 Upon completion you will be able to: User Datagram Protocol Be able to explain process-to-process communication Know.
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
Transport Layer TCP and UDP IS250 Spring 2010
8-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer m flow.
Gursharan Singh Tatla Transport Layer 16-May
Lecture 8 Modeling & Simulation of Communication Networks.
A question of protocol Geoff Huston APNIC 36. Originally there was RFC791: “All hosts must be prepared to accept datagrams of up to 576 octets (whether.
What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host IP treats a computer as an endpoint of communication Best.
The Transport Layer.
1 Chapter Overview TCP/IP DoD model. 2 Network Layer Protocols Responsible for end-to-end communications on an internetwork Contrast with data-link layer.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 7: Transport Layer Introduction to Networking.
Transport Layer Layer #4 (OSI-RM). Transport Layer Main function of OSI Transport layer: Accept data from the Application layer and prepare it for addressing.
Chapter 5 Transport layer With special emphasis on Transmission Control Protocol (TCP)
1 7-Oct-15 OSI transport layer CCNA Exploration Semester 1 Chapter 4.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 All.
1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003.
TCP: A Closer Look Transmission Control Protocol.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
TCP/IP Transport and Application (Topic 6)
Transport Layer: TCP and UDP. Overview of TCP/IP protocols Comparing TCP and UDP TCP connection: establishment, data transfer, and termination Allocation.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,
Transport Layer 3-1 Chapter 3 Outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP.
Chapter 9: Transport Layer
MULTIPLEXING/DEMULTIPLEXING, CONNECTIONLESS TRANSPORT.
Network Layer by peterl. forwarding table routing protocols path selection RIP, OSPF, BGP IP protocol addressing conventions datagram format packet handling.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
Cisco I Introduction to Networks Semester 1 Chapter 7 JEOPADY.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
Chapter 9: Transport Layer
Instructor Materials Chapter 9: Transport Layer
COMP2322 Lab 6 TCP Steven Lee Mar 29, 2017.
5. End-to-end protocols (part 1)
© 2003, Cisco Systems, Inc. All rights reserved.
Net 221D : Computer Networks Fundamentals
Magda El Zarki Professor, ICS UC, Irvine
Joao Damas, Geoff Labs March 2018
Figure 3-23: Transmission Control Protocol (TCP) (Study Figure)
TRANSMISSION CONTROL PROTOCOL
CPEG514 Advanced Computer Networkst
46 to 1500 bytes TYPE CODE CHECKSUM IDENTIFIER SEQUENCE NUMBER OPTIONAL DATA ICMP Echo message.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Chapter 5 Transport Layer Introduction
Transport Protocols: TCP Segments, Flow control and Connection Setup
IPv6 Reliability Measurements
Transport Layer 9/22/2019.
Presentation transcript:

An Experiment in Implementing a Stateless TCP DNS Server Geoff Huston APNIC

IP Networking 101 There are two major transport protocols in IP: – TCP when reliable data transfer is needed – UDP for simple lightweight transactions

IP Networking 102 Coping with large responses for transactions – What happens when the response size exceeds the path MTU? Use UDP with IP level fragmentation and reassembly to rebuild the protocol data unit – but firewalls often drop trailing IP fragments – IPv6 UDP path MTU handling is not well suited to transaction apps Use TCP segmentation and reassembly to rebuild the protocol data unit – switching to TCP implies additional load on the server, introduces limits on server transaction throughput, and adds additional delay in the elapsed time for the transaction

IP Networking 666 Fire up the Bad Idea Factory Why not combine UDP with TCP segmentation and reassembly? – The client runs a conventional TCP application – The server runs a stateless UDP-style application, but formats its output using TCP framing i.e. “Stateless TCP”

The Server’s Perspective Server SYN SYN+ACK 1. SYN Response Flip the IP source and destination fields Flip the TCP source and destination ports Use any old sequence number Offer a reasonable MSS (1220) Offer no other TCP options

Start with a sequence numbers given in the Request Send an ACK [Generate the response PDU] Chop the response into 512 octet segments – add TCP headers Send the response packet train back to back Send a FIN FIN The Server’s Perspective Server Request ACK [Response] 2. Request Response

The Server’s Perspective Server FIN ACK 3. FIN Response Flip the IP addrs, TCP ports and ack/sequence fields increment ack field send ACK

The Server’s Perspective 4. all else No server response

Can this be coded? A user space implementation of a stateless DNS TCP server that avoids kernel TCP processing Application pcap raw socket i/f device i/f

So far so good.. Can we use this approach to create a hybrid model of a TCP DNS client speaking to a stateless TCP DNS resolver? DNS resolver TCP DNS Client Stateless TCP

DNS and Stateless TCP To test if this approach could work I used a prototype config of a stateless TCP facing the client, and a UDP referral to a DNS resolver as the back end DNS resolver TCP DNS Client UDP Stateless TCP | UDP

It Worked! $ dig rand.apnic.net in any client > server.domain: S, cksum 0x9159 (correct), : (0) win server.domain > client.55998: S, cksum 0x82b9 (correct), : (0) ack win client > server.domain:., cksum 0x9986 (correct), 1:1(0) ack 1 win client > server.domain: P, cksum 0x41b2 (correct), 1:35(34) ack 1 win ANY? rand.apnic.net. (32) server.domain > client.55998:., cksum 0x9964 (correct), 1:1(0) ack 35 win server > backend.domain: ANY? rand.apnic.net. (32) backend.domain > server.54054: 30304* q: ANY? rand.apnic.net. 6/0/2 rand.apnic.net. SOA mirin.apnic.net. research.apnic.net , rand.apnic.net. NS mirin.apnic.net., rand.apnic.net. NS sec3.apnic.net., rand.apnic.net. MX kombu.apnic.net. 100, rand.apnic.net. MX karashi.apnic.net. 200, rand.apnic.net. MX fennel.apnic.net. 300 ar: sec3.apnic.net. A sec3.apnic.net, sec3.apnic.net. AAAA sec3.apnic.net (229) server.domain > client.55998:., cksum 0x421a (correct), 1:232(231) ack 35 win * q: ANY? rand.apnic.net. 6/0/2 rand.apnic.net. SOA mirin.apnic.net. research.apnic.net , rand.apnic.net. NS mirin.apnic.net., rand.apnic.net. NS sec3.apnic.net., rand.apnic.net. MX kombu.apnic.net. 100, rand.apnic.net. MX karashi.apnic.net. 200, rand.apnic.net. MX fennel.apnic.net. 300 ar: sec3.apnic.net. A sec3.apnic.net, sec3.apnic.net. AAAA sec3.apnic.net (229) server.domain > client.55998: F, cksum 0x987c (correct), 232:232(0) ack 35 win client > server.domain:., cksum 0x987d (correct), 35:35(0) ack 232 win client > server.domain:., cksum 0x987c (correct), 35:35(0) ack 233 win client > server.domain: F, cksum 0x987b (correct), 35:35(0) ack 233 win server.domain > client.55998:., cksum 0x987c (correct), 232:232(0) ack 36 win 65535

It Worked! dig rand.apnic.net in any client > server.domain: S, cksum 0x9159 (correct), : (0) win server.domain > client.55998: S, cksum 0x82b9 (correct), : (0) ack win client > server.domain:., cksum 0x9986 (correct), 1:1(0) ack 1 win client > server.domain: P, cksum 0x41b2 (correct), 1:35(34) ack 1 win ANY? rand.apnic.net. (32) server.domain > client.55998:., cksum 0x9964 (correct), 1:1(0) ack 35 win server > backend.domain: ANY? rand.apnic.net. (32) backend.domain > server.54054: 30304* q: ANY? rand.apnic.net. 6/0/2 rand.apnic.net. SOA mirin.apnic.net. research.apnic.net , rand.apnic.net. NS mirin.apnic.net., rand.apnic.net. NS sec3.apnic.net., rand.apnic.net. MX kombu.apnic.net. 100, rand.apnic.net. MX karashi.apnic.net. 200, rand.apnic.net. MX fennel.apnic.net. 300 ar: sec3.apnic.net. A sec3.apnic.net, sec3.apnic.net. AAAA sec3.apnic.net (229) server.domain > client.55998:., cksum 0x421a (correct), 1:232(231) ack 35 win * q: ANY? rand.apnic.net. 6/0/2 rand.apnic.net. SOA mirin.apnic.net. research.apnic.net , rand.apnic.net. NS mirin.apnic.net., rand.apnic.net. NS sec3.apnic.net., rand.apnic.net. MX kombu.apnic.net. 100, rand.apnic.net. MX karashi.apnic.net. 200, rand.apnic.net. MX fennel.apnic.net. 300 ar: sec3.apnic.net. A sec3.apnic.net, sec3.apnic.net. AAAA sec3.apnic.net (229) server.domain > client.55998: F, cksum 0x987c (correct), 232:232(0) ack 35 win client > server.domain:., cksum 0x987d (correct), 35:35(0) ack 232 win client > server.domain:., cksum 0x987c (correct), 35:35(0) ack 233 win client > server.domain: F, cksum 0x987b (correct), 35:35(0) ack 233 win server.domain > client.55998:., cksum 0x987c (correct), 232:232(0) ack 36 win TCP handshake

It Worked! dig rand.apnic.net in any client > server.domain: S, cksum 0x9159 (correct), : (0) win server.domain > client.55998: S, cksum 0x82b9 (correct), : (0) ack win client > server.domain:., cksum 0x9986 (correct), 1:1(0) ack 1 win client > server.domain: P, cksum 0x41b2 (correct), 1:35(34) ack 1 win ANY? rand.apnic.net. (32) server.domain > client.55998:., cksum 0x9964 (correct), 1:1(0) ack 35 win server > backend.domain: ANY? rand.apnic.net. (32) backend.domain > server.54054: 30304* q: ANY? rand.apnic.net. 6/0/2 rand.apnic.net. SOA mirin.apnic.net. research.apnic.net , rand.apnic.net. NS mirin.apnic.net., rand.apnic.net. NS sec3.apnic.net., rand.apnic.net. MX kombu.apnic.net. 100, rand.apnic.net. MX karashi.apnic.net. 200, rand.apnic.net. MX fennel.apnic.net. 300 ar: sec3.apnic.net. A sec3.apnic.net, sec3.apnic.net. AAAA sec3.apnic.net (229) server.domain > client.55998:., cksum 0x421a (correct), 1:232(231) ack 35 win * q: ANY? rand.apnic.net. 6/0/2 rand.apnic.net. SOA mirin.apnic.net. research.apnic.net , rand.apnic.net. NS mirin.apnic.net., rand.apnic.net. NS sec3.apnic.net., rand.apnic.net. MX kombu.apnic.net. 100, rand.apnic.net. MX karashi.apnic.net. 200, rand.apnic.net. MX fennel.apnic.net. 300 ar: sec3.apnic.net. A sec3.apnic.net, sec3.apnic.net. AAAA sec3.apnic.net (229) server.domain > client.55998: F, cksum 0x987c (correct), 232:232(0) ack 35 win client > server.domain:., cksum 0x987d (correct), 35:35(0) ack 232 win client > server.domain:., cksum 0x987c (correct), 35:35(0) ack 233 win client > server.domain: F, cksum 0x987b (correct), 35:35(0) ack 233 win server.domain > client.55998:., cksum 0x987c (correct), 232:232(0) ack 36 win TCP request and referral to UDP DNS backend

It Worked! dig rand.apnic.net in any client > server.domain: S, cksum 0x9159 (correct), : (0) win server.domain > client.55998: S, cksum 0x82b9 (correct), : (0) ack win client > server.domain:., cksum 0x9986 (correct), 1:1(0) ack 1 win client > server.domain: P, cksum 0x41b2 (correct), 1:35(34) ack 1 win ANY? rand.apnic.net. (32) server.domain > client.55998:., cksum 0x9964 (correct), 1:1(0) ack 35 win server > backend.domain: ANY? rand.apnic.net. (32) backend.domain > server.54054: 30304* q: ANY? rand.apnic.net. 6/0/2 rand.apnic.net. SOA mirin.apnic.net. research.apnic.net , rand.apnic.net. NS mirin.apnic.net., rand.apnic.net. NS sec3.apnic.net., rand.apnic.net. MX kombu.apnic.net. 100, rand.apnic.net. MX karashi.apnic.net. 200, rand.apnic.net. MX fennel.apnic.net. 300 ar: sec3.apnic.net. A sec3.apnic.net, sec3.apnic.net. AAAA sec3.apnic.net (229) server.domain > client.55998:., cksum 0x421a (correct), 1:232(231) ack 35 win * q: ANY? rand.apnic.net. 6/0/2 rand.apnic.net. SOA mirin.apnic.net. research.apnic.net , rand.apnic.net. NS mirin.apnic.net., rand.apnic.net. NS sec3.apnic.net., rand.apnic.net. MX kombu.apnic.net. 100, rand.apnic.net. MX karashi.apnic.net. 200, rand.apnic.net. MX fennel.apnic.net. 300 ar: sec3.apnic.net. A sec3.apnic.net, sec3.apnic.net. AAAA sec3.apnic.net (229) server.domain > client.55998: F, cksum 0x987c (correct), 232:232(0) ack 35 win client > server.domain:., cksum 0x987d (correct), 35:35(0) ack 232 win client > server.domain:., cksum 0x987c (correct), 35:35(0) ack 233 win client > server.domain: F, cksum 0x987b (correct), 35:35(0) ack 233 win server.domain > client.55998:., cksum 0x987c (correct), 232:232(0) ack 36 win TCP response to client

It Worked! dig rand.apnic.net in any client > server.domain: S, cksum 0x9159 (correct), : (0) win server.domain > client.55998: S, cksum 0x82b9 (correct), : (0) ack win client > server.domain:., cksum 0x9986 (correct), 1:1(0) ack 1 win client > server.domain: P, cksum 0x41b2 (correct), 1:35(34) ack 1 win ANY? rand.apnic.net. (32) server.domain > client.55998:., cksum 0x9964 (correct), 1:1(0) ack 35 win server > backend.domain: ANY? rand.apnic.net. (32) backend.domain > server.54054: 30304* q: ANY? rand.apnic.net. 6/0/2 rand.apnic.net. SOA mirin.apnic.net. research.apnic.net , rand.apnic.net. NS mirin.apnic.net., rand.apnic.net. NS sec3.apnic.net., rand.apnic.net. MX kombu.apnic.net. 100, rand.apnic.net. MX karashi.apnic.net. 200, rand.apnic.net. MX fennel.apnic.net. 300 ar: sec3.apnic.net. A sec3.apnic.net, sec3.apnic.net. AAAA sec3.apnic.net (229) server.domain > client.55998:., cksum 0x421a (correct), 1:232(231) ack 35 win * q: ANY? rand.apnic.net. 6/0/2 rand.apnic.net. SOA mirin.apnic.net. research.apnic.net , rand.apnic.net. NS mirin.apnic.net., rand.apnic.net. NS sec3.apnic.net., rand.apnic.net. MX kombu.apnic.net. 100, rand.apnic.net. MX karashi.apnic.net. 200, rand.apnic.net. MX fennel.apnic.net. 300 ar: sec3.apnic.net. A sec3.apnic.net, sec3.apnic.net. AAAA sec3.apnic.net (229) server.domain > client.55998: F, cksum 0x987c (correct), 232:232(0) ack 35 win client > server.domain:., cksum 0x987d (correct), 35:35(0) ack 232 win client > server.domain:., cksum 0x987c (correct), 35:35(0) ack 233 win client > server.domain: F, cksum 0x987b (correct), 35:35(0) ack 233 win server.domain > client.55998:., cksum 0x987c (correct), 232:232(0) ack 36 win FIN close

But … Its just like UDP in almost every respect: no reliability, no flow control, and absolutely no manners whatsoever! And its really a Bad Idea!

Code and ACK The FreeBSD code used here for the Stateless DNS proxy can be found at: ss This Bad Idea was cooked up in collaboration with George Michaelson