CS计算机代考程序代写 dns Java DHCP Excel The Internet and Sockets

The Internet and Sockets
The Internet and Sockets
147 / 180

The Internet and Sockets
It¡¯s quite hard to explain what the Internet actually is
¡°The Internet is not something that you just dump something on. It¡¯s not a big truck. It¡¯s a series of tubes.¡±
Ted Stevens, US Senator
148 / 180

The Internet and Sockets
Before the Internet
Computer Networks: local networks
telephone line connections leased line.
149 / 180

The Internet and Sockets
The Start 1969
The US Defense Advanced Research Projects Agency (then ARPA now DARPA) gives research grants to universities to buy computers.
They decide to link their computers. But how?
150 / 180

The Internet and Sockets
The Problem With Leased Lines
151 / 180

The Internet and Sockets
The Problem With Leased Lines
If A and D use the line, then C and B cannot.
152 / 180

The Internet and Sockets
The problem with Leased Lines
But if everone just sends a small packet of data, they can both use the line at the same time.
153 / 180

The Internet and Sockets
154 / 180

The Internet and Sockets
155 / 180

The Internet and Sockets
156 / 180

The Internet and Sockets
157 / 180

The Internet and Sockets
158 / 180

The Internet and Sockets
159 / 180

The Internet and Sockets
Traceroute
160 / 180

The Internet and Sockets
http://www.theguardian.com/business/2013/aug/02/ telecoms-bt-vodafone-cables-gchq
161 / 180

The Internet and Sockets
Transmission Control Protocol
1974: daily traffic more than 3 million packets a day. Many are getting lost.
TCP is a protocol than runs on top on IP, if an IP packet gets lost. It requests that it is resent.
TCP/IP becomes standard and allows Inter network connections.
162 / 180

The Internet and Sockets
Domain Name Servers (DNS)
Remembering IP address is hard.
So people associate names with addresses.
e.g. news.bbc.com ¡ú 212.58.226.141
A hierarchy of servers list handle requests
The route for most of Europe is RIPE based in Amsterdam.
163 / 180

The Internet and Sockets
Ports
To allow multiple connections TCP uses ¡°ports¡±
A TCP ¡°Socket¡± connection is defined by:
(destination IP, destination port, source IP,
source port)
The destination port normally depends on the service: WWW runs on port 80, ssh on port 22, dns on 53…
The source port is normally chosen at random.
164 / 180

The Internet and Sockets
Netcat
Netcat is a tool to make Internet connections. Syntax varies between OS.
listen on 1337: nc -l 1337
connect to machine 127.0.0.1 on port 1337:
nc 127.0.0.1 1337
165 / 180

The Internet and Sockets
Nmap
Check if 1000 most common ports are open:
nmap 127.0.0.1
Additionally send messages to ports to find out what the service is:
nmap -A 127.0.0.1
Scan all ports
nmap -p- 127.0.0.1
166 / 180

The Internet and Sockets
Nmap demo
167 / 180

The Internet and Sockets
The Internet Protocol Stack
Internet communication uses a stack of protocols.
Each protocol uses the protocol below it to sent data.
168 / 180

The Internet and Sockets
The Stack, Most of the Time
169 / 180

The Internet and Sockets
The Stack, Most of the Time
170 / 180

The Internet and Sockets
The Stack, Most of the Time
171 / 180

The Internet and Sockets
The Stack, Most of the Time
172 / 180

The Internet and Sockets
MAC and IP Addresses
Every machine has a unique MAC address (media access control) e.g. 48:d7:05:d6:7a:51.
Every computer on the Internet has an IP address, e.g., 147.188.193.15.
NAT address 10.*.*.* and 192.168.*.* are not unique local addresses.
173 / 180

The Internet and Sockets
DHCP and ARP
Dynamic Host Configuration Protocol:
Assigns an IP address to a new machine (MAC address). Not stored long term.
Address Resolution Protocol (ARP)
Lets router find out which IP address is being used by which
machine.
ARP spoofing lets one machine steal the IP address of another on the same network.
174 / 180

The Internet and Sockets
Wireshark
A network protocol analyzer: It records all Internet traffic, so it can then be viewed and analysed.
Excellent for debugging protocols and network problems See also tcpdump, which writes packets directly to disk.
175 / 180

The Internet and Sockets
Using the Stack to Send Data
176 / 180

The Internet and Sockets
Using the Stack To Send Data
177 / 180

The Internet and Sockets
Our View of the Stack in Java
178 / 180

The Internet and Sockets
Java Sockets demo
179 / 180

The Internet and Sockets
¡°The Attacker Owns the Network¡±
The Internet was not designed with security in mind. Traffic may be monitored or altered.
All good security products assume that the attacker has complete control over the network (but can¡¯t break encryption)
180 / 180