TCP/IP Programming Basics Recall the Basics of TCP/IP

Total Page:16

File Type:pdf, Size:1020Kb

TCP/IP Programming Basics Recall the Basics of TCP/IP TCP/IP Programming Basics recall the basics of TCP/IP IP uses datagrams TCP uses segments TCP is stream-oriented (programs read and write byte streams to communicate) “client” initiates connection with “server” multiplexing (demultiplexing) uses ports programs use sockets what is the difference between socket and port? 1 the socket approach client and server (these are just names for the two applications at the endpoints of a connection) read from sockets, write to sockets, in the same way programs read from files and write to ¡ ¢¥¤ £ ¥¢ files using file descriptors like ¡£¢¥¤§¦©¨ , , etc client server sockets ports connection Host A Host B 2 useful programming background network programming is complicated because two programs are running at the same time (client and server) useful to have two windows, one for client, one for server can debug on one host, using loopback address name — ¥ ¥¡£¢ address — port — any number greater than 1024; usually choose some number greater than 5000 system call to get time of day system call to “timeout” if server unavailable networking calls to convert name into address, etc (see Pocket Socket Guide) know how to cast byte string in various ways be aware of different binary representations on different hard- ware multi-tasking basics needed if multiple concurrent clients per server 3 Linux and non-LAN Links modems, ISDN lines, etc — point to point links not covered here, but textbook covers some of these SLIP (Serial Line IP) PPP (Point-to-Point Protocol) SLiRP (TCP/IP emulator turning an ordinary shell into (C)SLIP/PPP) problem suppose host B is on the Internet, and we wish to have host A dial up (using SLIP/PPP) host B and then use Internet applications (www, etc) host A does not have an IP address (and even if DHCP used, host B may not have an extra IP address to give to host A) — what can be done? 4 A B C SLIP Internet host A unknown in global Internet (only dialed in to B) — how can C and A communicate? primitive solution: user on A uses ¢ ¨!"¢ to B (user must have account on host B), then all subsequent com- mands appear to originate at B note: even X-windows is possible ¤§¦&¡('§") *,+- (use command such as ¡#"¢$¨ % ) A B C packets for X-windows ftp, www, etc drawback: can’t copy file from C to A easily 5 proxy ARP idea: change ARP so that more than one IP address can be associated with an interface motivation: to “extend” LAN to hosts that aren’t really on the LAN x y dialup LAN host x has two IP addresses I1 and I2, one for itself (I1) and I2 for y, so that the any datagram with destination I2 will arrive on x’s interface if y isn’t dialed in when datagram with destination I2 arrives at x, then datagram will be discarded / note: for any host t in LAN, t . x, the ARP table for t can have two IP addresses (I1 and I2) for x’s hardware Ethernet address host x is similar to a gateway — but no need for a new subnet 6 more complicated use of proxy ARP x LAN not on Internet y1 y3 LAN on Internet y2 y4 proxy ARP associates all IP addresses of y1–y4 with x’s interface on primary (Internet) LAN — so other hosts send anything for y1–y4 to x’s interface host x can use netmask in routing table to route y1, y2, etc via secondary interface with one row in x’s routing table not a true subnet for more details, see Linux HOWTO for Proxy ARP 7 HTTP proxy www server http proxy web users (yahoo) using HTTP proxy server, many web users all appear (to yahoo) to have the same IP address — namely the proxy’s IP address acts as “concentrator” of web requests can be a shared cache of web pages security possibilities (hide real IP address of user) control possibilities (block some kinds of web pages) transparent to users (proxy is almost invisible) what are shared themes of Proxy ARP and HTTP Proxy? 1. one host acts on behalf of others ( / proxy) 2. to outside hosts, proxy is not visible implies no need to change Internet protocols and servers! this is important design principle! 8.
Recommended publications
  • Internetworking with TCP/IP
    Internetworking With TCP/IP Douglas Comer Computer Science Department Purdue University 250 N. University Street West Lafayette, IN 47907-2066 http://www.cs.purdue.edu/people/comer Copyright 2005. All rights reserved. This document may not be reproduced by any means without written consent of the author. PART I COURSE OVERVIEW AND INTRODUCTION Internetworking With TCP/IP vol 1 -- Part 1 1 2005 Topic And Scope Internetworking: an overview of concepts, terminology, and technology underlying the TCP/IP Internet protocol suite and the architecture of an internet. Internetworking With TCP/IP vol 1 -- Part 1 2 2005 You Will Learn Terminology (including acronyms) Concepts and principles ± The underlying model ± Encapsulation ± End-to-end paradigm Naming and addressing Functions of protocols including ARP, IP, TCP, UDP, SMTP, FTP, DHCP, and more Layering model Internetworking With TCP/IP vol 1 -- Part 1 3 2005 You Will Learn (continued) Internet architecture and routing Applications Internetworking With TCP/IP vol 1 -- Part 1 4 2005 What You Will NOT Learn A list of vendors, hardware products, software products, services, comparisons, or prices Alternative internetworking technologies (they have all disappeared!) Internetworking With TCP/IP vol 1 -- Part 1 5 2005 Schedule Of Topics Introduction Review of ± Network hardware ± Physical addressing Internet model and concept Internet (IP) addresses Higher-level protocols and the layering principle Examples of internet architecture Internetworking With TCP/IP vol 1 -- Part 1 6 2005 Schedule Of Topics
    [Show full text]
  • Ubuntu Server Guide Basic Installation Preparing to Install
    Ubuntu Server Guide Welcome to the Ubuntu Server Guide! This site includes information on using Ubuntu Server for the latest LTS release, Ubuntu 20.04 LTS (Focal Fossa). For an offline version as well as versions for previous releases see below. Improving the Documentation If you find any errors or have suggestions for improvements to pages, please use the link at thebottomof each topic titled: “Help improve this document in the forum.” This link will take you to the Server Discourse forum for the specific page you are viewing. There you can share your comments or let us know aboutbugs with any page. PDFs and Previous Releases Below are links to the previous Ubuntu Server release server guides as well as an offline copy of the current version of this site: Ubuntu 20.04 LTS (Focal Fossa): PDF Ubuntu 18.04 LTS (Bionic Beaver): Web and PDF Ubuntu 16.04 LTS (Xenial Xerus): Web and PDF Support There are a couple of different ways that the Ubuntu Server edition is supported: commercial support and community support. The main commercial support (and development funding) is available from Canonical, Ltd. They supply reasonably- priced support contracts on a per desktop or per-server basis. For more information see the Ubuntu Advantage page. Community support is also provided by dedicated individuals and companies that wish to make Ubuntu the best distribution possible. Support is provided through multiple mailing lists, IRC channels, forums, blogs, wikis, etc. The large amount of information available can be overwhelming, but a good search engine query can usually provide an answer to your questions.
    [Show full text]
  • Porting the QEMU Virtualization Software to MINIX 3
    Porting the QEMU virtualization software to MINIX 3 Master's thesis in Computer Science Erik van der Kouwe Student number 1397273 [email protected] Vrije Universiteit Amsterdam Faculty of Sciences Department of Mathematics and Computer Science Supervised by dr. Andrew S. Tanenbaum Second reader: dr. Herbert Bos 12 August 2009 Abstract The MINIX 3 operating system aims to make computers more reliable and more secure by keeping privileged code small and simple. Unfortunately, at the moment only few major programs have been ported to MINIX. In particular, no virtualization software is available. By isolating software environments from each other, virtualization aids in software development and provides an additional way to achieve reliability and security. It is unclear whether virtualization software can run efficiently within the constraints of MINIX' microkernel design. To determine whether MINIX is capable of running virtualization software, I have ported QEMU to it. QEMU provides full system virtualization, aiming in particular at portability and speed. I find that QEMU can be ported to MINIX, but that this requires a number of changes to be made to both programs. Allowing QEMU to run mainly involves adding standardized POSIX functions that were previously missing in MINIX. These additions do not conflict with MINIX' design principles and their availability makes porting other software easier. A list of recommendations is provided that could further simplify porting software to MINIX. Besides just porting QEMU, I also investigate what performance bottlenecks it experiences on MINIX. Several areas are found where MINIX does not perform as well as Linux. The causes for these differences are investigated.
    [Show full text]
  • Network Driver for Micro Os Xv6
    NETWORK DRIVER FOR MICRO OS XV6 A Project Presented to the faculty of the Department of Computer Science California State University, Sacramento Submitted in partial satisfaction of the requirements for the degree of MASTER OF SCIENCE in Computer Science by Anmoldeep Singh Sandhu SPRING 2020 © 2020 Anmoldeep Singh Sandhu ALL RIGHTS RESERVED ii NETWORK DRIVER FOR MICRO OS XV6 A Project by Anmoldeep Singh Sandhu Approved by: __________________________________, Committee Chair Dr. Jinsong Ouyang __________________________________, Second Reader Dr. Jingwei Yang ____________________________ Date iii Student: Anmoldeep Singh Sandhu I certify that this student has met the requirements for format contained in the University format manual, and this thesis is suitable for electronic submission to the library. Credit is awarded for the Project. __________________________, Graduate Coordinator ___________________ Dr. Jinsong Ouyang Date Department of Computer Science iv Abstract of NETWORK DRIVER FOR MICRO OS XV6 by Anmoldeep Singh Sandhu The network driver is one of the primary requirements for any operating system. Xv6 is a micro-operating system based on version 6 Unix. The latest version of xv6 does not have support for the ethernet driver or the four-layer UDP/IP model. Our work extends the xv6 operating system to support a functioning network driver with the capability of handling a packet burst. This Project also adds support for UDP/IP and Ethernet protocol to the xv6 operating system. _______________________ Committee Chair Dr. Jinsong Ouyang _____________________ Date v ACKNOWLEDGMENTS I am thankful to Dr. Ouyang for providing me the opportunity to learn new skills in the field of driver development. Dr. Ouyang showed trust in me in carrying out this Project.
    [Show full text]
  • ADB (Android Debug Bridge): How It Works?
    ADB (Android Debug Bridge): How it works? 2012.2.6 early draft Tetsuyuki Kobayashi 1 Let's talk about inside of Android. http://www.kmckk.co.jp/eng/kzma9/ 2 http://www.kmckk.co.jp/eng/jet_index.html Who am I? 20+ years involved in embedded systems 10 years in real time OS, such as iTRON 10 years in embedded Java Virtual Machine Now GCC, Linux, QEMU, Android, … Blogs http://d.hatena.ne.jp/embedded/ (Personal) http://blog.kmckk.com/ (Corporate) http://kobablog.wordpress.com/(English) Twitter @tetsu_koba 3 What is ADB? If you are an Android builder, you have used ”adb logcat”, ”adb shell” Even if you only use DDMS in Eclipse, adb is working under the hood. Using adb, you can connect emulator or actual target device. ”adb kill-server”? what does it mean? 4 How to connect? Host Target device Emulator Adb clients ”adb shell” Adbd How to connect? QEMU Adbd 5 ADB overview Host Target device Execute services on Emulator new thread/subprocess Adb clients Adbd TCP port:5037 TCP Adb server QEMU USB/TCP Adbd 6 2 roles of ADB Providing ”Transport” communication path between host and target device USB or TCP: but clients don't have to aware Providing ”Services” executing something on the target devices through the transport. ”adb shell” for executing command ”adb push/pull” for file transfer 7 3 elements of ADB adb clients executable with subcommand ”adb shell”, ”adb logcat” : the end point of host side adb server running on host on back-ground act as proxy between adb clients and adbd adb daemon (adbd) running on target device started by init, if die, restarted by init again 8 When does adb server start? Explicitly, ”adb start-server” It starts adb server as back ground process.
    [Show full text]
  • Cover Slide Title
    Developer Day Class Stephano Cetola, Armin Kuster, Scott Murray, David Reyna, Rudolf J Streif, Joshua Watt Yocto Project Developer Day San Diego 20 August 2019 Welcome DevDay Class San Diego 2019! • Class Content (download these slides!): • https://wiki.yoctoproject.org/wiki/DevDay_San_Diego_2019 • Lab Requirements: • Wireless connection: same as ELCE conference • SSH (Windows: e.g. “putty”) • Wireless Registration: • Will be passed out 2 Agenda – The Developer Day Class 9:00- 9:10 Keynote 9:10- 9:15 Lab account setup 9:15-10:15 Hash Equivalency/Runqueue 10:15-10:30 Morning Break 10:30-12:00 User Space Topics 12:00-12:30 Lunch 12:30- 1:10 Package Feeds 1:10- 1:40 Mirrors and SState 1:40- 2:40 WIC 2:10- 2:30 Afternoon Break 2:30- 3:30 Container building/Multiconfig 3:30- 4:30 Devtool 4:30- 5:00 Tools, Toaster, User Experience 5:00- 5:30 Forum, Q and A 3 Activity One Keynote Nicolas Dechesne Outline • Yocto Project Dev Day • Yocto Project updates • Yocto Project Summit 2019 • Yocto Project at ELC • Join us! 5 Yocto Project Dev Day • Very important event for us • we really enjoy meeting new users • we really value feedback from the field! • Don’t hesitate to ask questions, take as much as possible from the great speakers today! • We need more users, contributors and maintainers! • Send us feedback! 6 Yocto Project releases • 2.6.1, 2.6.2, 2.6.3 • So far, for 3.0 – ~600 changes – ~1500 changes – 94 developers – 136 developers • 2.7 and 2.7.1 – ~1900 changes – 177 developers 7 What’s coming in 3.0 , aka “zeus” • Autobuilder infrastructure hardware refreshed • Many recipe updates, including significant removal of old or obsolete software to ensure modern and up-to-date core Linux software stack • Support for the latest host distributions • Pre-merge testing on IA and ARM using QEMU/KVM (ptest, LTP, tracking build performance) • Build change equivalence is detected and used to avoid rebuilding unchanged components No other cross compiling build system is as complete or functional.
    [Show full text]
  • The Implications of Virtual Environments in Digital Forensic Investigations
    THE IMPLICATIONS OF VIRTUAL ENVIRONMENTS IN DIGITAL FORENSIC INVESTIGATIONS by FARRAH M. PATTERSON B.S. University of Tampa, 2007 A thesis submitted in partial fulfillment for the degree of Master of Science in the Department of Digital Forensics in the College of Engineering and Computer Science at the University of Central Florida Orlando, Florida Fall Term 2011 ABSTRACT This research paper discusses the role of virtual environments in digital forensic investigations. With virtual environments becoming more prevalent as an analysis tool in digital forensic investigations, it’s becoming more important for digital forensic investigators to understand the limitation and strengths of virtual machines. The study aims to expose limitations within commercial closed source virtual machines and open source virtual machines. The study provides a brief overview of history digital forensic investigations and virtual environments, and concludes with an experiment with four common open and closed source virtual machines; the effects of the virtual machines on the host machine as well as the performance of the virtual machine itself. My findings discovered that while the open source tools provided more control and freedom to the operator, the closed source tools were more stable and consistent in their operation. The significance of these findings can be further researched by applying them in the context of exemplifying reliability of forensic techniques when presented as analysis tool used in litigation. ii TABLE OF CONTENTS LIST OF FIGURES ...................................................................................................................................
    [Show full text]
  • Integration of KVM in the Openhuaca Cloud Platform
    Integration of KVM in the Openhuaca Cloud Platform A Degree Thesis Submitted to the Faculty of the Escola Tècnica d'Enginyeria de Telecomunicació de Barcelona Universitat Politècnica de Catalunya by Daniel Campos Gómez In partial fulfilment of the requirements for the degree in NETWORK ENGINEERING Advisor: Jose Luis Muñoz Tapia Barcelona, June 2018 Abstract The purpose of this project is the integration of KVM technology into a cloud platform called Openhuaca that lets the user of the software the possibility of creating and managing virtual containers and virtual machines in an easy and fast way. Besides, it can be administrated with domains. It is thought to be implemented in small or medium stages; for example, in a teaching area to help all the students’ necessities in a centralized way. Therefore, every student can connect to all virtualized facilities with their specific digital certificate. The complexity of the project has made it necessary to create a working team formed by a supervisor, ex-students and various TFG students from different universities in order to review and introduce new functionalities to the project efficiently and quicker. 1 Resum L’objectiu d’aquest projecte és integrar la tecnología KVM a una plataforma cloud anomenada Openhuaca. Aquesta plataforma permeteix a l’usuari crear i gestionar diversos contenedors i màquines virtuals d’una manera ràpida i senzilla. A més, pot ser administrada per diversos dominis. Aquest projecte està pensat per a petits o mitjans entorns, per exemple, a l’àrea docent per poder controlar els ordinadors dels laboratoris de la Universitat. Openhuaca està pensat per cobrir les necessitats dels alumnes de forma centralitzada.
    [Show full text]
  • VDE: Virtual Distributed Ethernet
    VDE: Virtual Distributed Ethernet Renzo Davoli∗ Department of Computer Science University of Bologna, Italy email: [email protected] Abstract permits the concurrent execution and communication of several virtual or emulated machines through an emulated The idea of VDE is very effective but straightforward network. These tools however fail in generality and distri- simple and can be applied in very many configuration to bution: in generality as they are tailored to one single kind provide several services. It is a sort of Swiss knife of em- of virtual or emulated machine, in distribution as everything ulated networks. It can be used as a general Virtual Pri- (emulate machinesand the network emulator itself) must re- vate network as well as a support technology for mobility, side and run on the same real computer. a tool for network testing, a general reconfigurable over- It is possible to create a completely virtual/emulated net- lay network, a layer for implementing privacy preserving working space by using VDE together with virtual ma- technologies and many others. A prototype VDE has been chines on a set of real (based on hardware, physical) com- implemented and released as Free Software under the GPL puters connected by a real network. This second layer licence [11]. of virtuality has been also named as Virtual Square [12]. Square has here the double meaning of squared (i.e. el- evated to the second power) and of a virtual place where 1 Introduction machines and humans can meet. The remaining if the paper is organized as follows. Sec- tion 2 presents the structure and the composing entities of The acronym VDE is self explaining: it is a Virtual net- a VDE, section 3 explains some examples of VDE apppli- work because it is built completely in software, it is Dis- cations.
    [Show full text]
  • Memory-Safe Network Services Through a Userspace Networking Switch
    Technische Universität Berlin, Germany Korea Advanced Institute of Science and Faculty IV – Electrical Engineering and Technology (KAIST), South Korea Computer Science, Department of School of Computing Telecommunication Systems Advanced Networking Lab Internet Network Architectures (FG INET) Master Thesis Memory-safe Network Services Through A Userspace Networking Switch Kai Lüke [email protected] Dual-Degree Master Computer Science Supervisors: Prof. Anja Feldmann (TU Berlin) Prof. Sue Moon (KAIST) January 11, 2019 Erklärung der Urheberscha Hiermit erkläre ich, dass ich die vorliegende Arbeit selbstständig und eigenhändig sowie ohne uner- laubte fremde Hilfe und ausschließlich unter Verwendung der aufgeührten Quellen und Hilfsmittel angefertigt habe. Berlin 11. Januar 2019 Unterschrift I hereby declare that the thesis submitted is my own, unaided work, completed without any unper- mitted external help. Only the sources and resources listed were used. Berlin January 11, 2019 Signature Abstract A network service needs to be resilient against malicious input from the Internet. Specially programs wrien in C are prone to memory corruption bugs which are the basis for remote code execution at- tacks. Memory-safe languages solve this problem for application code running in userspace. The TCP/IP network stack however runs in the operating system kernel, which is wrien in C and vulnerable to mem- ory corruption. Therefore, this work explored moving the TCP/IP stack into the memory-safe userspace process while providing a compatible API. The process should share an IP address with the kernel and integrate with the kernel’s loopback interface. This solution keeps the benefits of a full-featured OS and does not impose different IPs per process or changes in the application logic.
    [Show full text]
  • Pbuilder Documentation Release 0.213
    pbuilder Documentation Release 0.213 PBuilder Team May 24, 2017 Contents 1 Table Of Contents 3 2 Indices and tables 23 i ii pbuilder Documentation, Release 0.213 Note: This is not official documentation: it’s just an attempt to format it for sphinx so ReadTheDocs service could be used. The official documentation can be browsed at http://pbuilder.alioth.debian.org/ This particular document is also available as: • EPub • PDF Last built: May 24, 2017 Contents 1 pbuilder Documentation, Release 0.213 2 Contents CHAPTER 1 Table Of Contents Introducing pbuilder Aims of pbuilder pbuilder stands for Personal Builder, and it is an automatic Debian Package Building system for personal develop- ment workstation environments. pbuilder aims to be an easy-to-setup system for auto-building Debian packages inside a clean-room environment, so that it is possible to verify that a package can be built on most Debian installa- tions. The clean-room environment is achieved through the use of a base chroot image, so that only minimal packages will be installed inside the chroot. The Debian distribution consists of free software accompanied with source. The source code within Debian’s “main” section must build within Debian “main”, with only the explicitly specified build-dependencies installed. The primary aim of pbuilder is different from other auto-building systems in Debian in that its aim is not to try to build as many packages as possible. It does not try to guess what a package needs, and in most cases it tries the worst choice of all if there is a choice to be made.
    [Show full text]
  • Sshuttle Documentation Release 0.78.1.Dev0+Nga8b2883.D20160409
    sshuttle documentation Release 0.78.1.dev0+nga8b2883.d20160409 Brian May April 09, 2016 Contents 1 Overview 3 2 Requirements 5 2.1 Client side Requirements.........................................5 2.2 Server side Requirements........................................6 2.3 Additional Suggested Software.....................................6 3 Installation 7 4 Usage 9 4.1 Usage Notes...............................................9 5 Platform Specific Notes 11 5.1 TPROXY................................................. 11 5.2 Microsoft Windows........................................... 12 6 sshuttle 13 6.1 Synopsis................................................. 13 6.2 Description................................................ 13 6.3 Options.................................................. 13 6.4 Examples................................................. 15 6.5 Discussion................................................ 16 7 How it works 17 8 Support 19 9 Useless Trivia 21 10 Changelog 23 10.1 Release 0.78.0 (Apr 8, 2016)....................................... 23 10.2 Release 0.77.2 (Mar 7, 2016)...................................... 23 10.3 Release 0.77.1 (Mar 7, 2016)...................................... 23 10.4 Release 0.77 (Mar 3, 2016)....................................... 23 10.5 Release 0.76 (Jan 17, 2016)....................................... 24 10.6 Release 0.75 (Jan 12, 2016)....................................... 24 10.7 Release 0.74 (Jan 10, 2016)....................................... 24 11 Indices and tables 25 i ii sshuttle
    [Show full text]