search the web

Sunday, August 28, 2016

HTTPS

HTTPS

HTTPS stands for Hypertext Transfer Protocol over Secure Socket
Layer, or HTTP over SSL.
- SSL acts like a sub layer under regular HTTP application
- HTTPS encrypts an HTTP message prior to transmission and
decrypts a message upon arrival.

What are certificates?

For secure communication over untrusted networks we need to encrypt the
traffic. That is often done with SSL/TLS.
Transport Layer Security (TLS) and its predecessor, Secure Sockets Layer
(SSL), are cryptographic protocols that provide secure communications on
the Internet for such things as web browsing, e-mail, Internet faxing, instant
messaging and other data transfers.

What is a Certification Authority?

For organizations and servers a hierarchical key system is invented,
where a "Certification Authority" (CA) can "sign" key-pairs for multiple
servers or users.
It means the CA confirms the authenticity of the keys and its holders.
If a computer / user trust this CA, they automatically trust all keys that were
signed by it.
In such a scenario we call the public keys "certificates".

HTTPS Transaction

HTTPS Transaction
HTTPS Transaction

SSL as HTTP Security Concerns


Secure Sockets Layer technology protects Web site and makes it easy for Web site
visitors to trust in three essential ways:
Privacy
An SSL Certificate enables encryption of sensitive information during online
transactions.
Integrity
A Certificate Authority verifies the identity of the certificate owner when it is issued.
Authentication
Each SSL Certificate contains unique, authenticated information about the
certificate owner.

Web Server (www)

Is to serve www. (web sites)
Try them !
- Apache Web Server
very large and powerful, a lot of extensions
- Lighttpd
small but also provides some dynamic content
- Apache Tomcat
web server that provides servlet container (java servlets, jsp)

Monday, August 22, 2016

Principles of Application Layer Protocols (HTTP_2)

Principles of Application Layer Protocols (HTTP_2)

HTTP Performance

What effects?

Different kinds of requests:
– Lots of small requests (loading a web page)
– Big request (fetching a download)
Requires different solutions!

Small requests

Latency matters:

Governed by RTT between hosts.
Two major causes of delay:
– Opening a TCP connection
– Data response-request
Solutions:
– Persistent connections (Why?)
– Pre-fetching !
– Others?

Big requests

Eg: When doing a big request (big file to download).
Problem is throughput on bottleneck links (usually edge links)
A solution:
Use an HTTP proxy cache or mirror
– Can also improve latency!
big requests in HTTP
big requests in HTTP

Old Cached Data

Cache needs a way to conditionally ask for a document as Items in the cache
can get staled ( eg: We don’t want to read stored of weeks ago)
- Cache can issue a conditional GET (with an “If-modified-since”
header)
- Server can reply with a “304 Not Modified”

Web caching

Cache acts as both client and server.
- Typically cache is installed by ISP (university, company,
residential ISP)
- Reduce response time for client request
- Reduce traffic on an institution’s access link

HTTP Transaction

HTTP Transaction
HTTP Transaction



Thursday, August 18, 2016

Principles of Application Layer Protocols (HTTP)

Principles of Application Layer Protocols (HTTP)

The World Wide Web: HTTP

The Hypertext Transfer Protocol (HTTP), the Web's application-layer protocol,
is at the heart of the Web.
HTTP is implemented in two programs: a client program and server program.
The client program and server programs, executing on different end systems,
talk to each other by exchanging HTTP messages.
HTTP server maintains no information about the clients, HTTP is said to be a
stateless protocol. It does not have to keep track of any user state.

Three components:

- File transfer protocol:HTTP (hyper text transfer protocol); uses TCP
- Format for documents with links (“hyperdocuments”): HTML (hyper text
markup language)
- URLs (universal resource locators)
HTTP
HTTP

- Web page consists of objects
- Object can be HTML file, JPEG image, Java applet, audio file,…
- Web page consists of base HTML-file which includes several
referenced objects
- Each object is addressable by a URL (Uniform Resource Locator)

URL

- Identify documents to be transferred and application layer protocol
to use

for example:
http://www.ccnatutorials.com/2016/02/ethernet.html
HTTP and URL
HTTP and URL

http overview
http overview

HTTP overview

HTTP: hypertext transfer protocol            
Web’s application layer protocol
client/server model
– client: browser that requests,
receives, “displays” Web objects
– server: Web server sends objects
in response to requests
HTTP 1.0: RFC 1945
HTTP 1.1: RFC 2068











HTTP uses TCP

Open TCP connection
Open TCP connection

Uses TCP:
- Client initiates TCP connection
(creates socket) to server, port 80
- Server accepts TCP connection
from client
- When HTTP messages (applicationlayer
protocol messages) exchanged
between browser (HTTP client) and
Web server (HTTP server)
TCP connection will be closed
HTTP is “stateless”
server maintains no information
about past client requests !?
Protocols that maintain “state”
are complex!
- past history (state) must
be maintained
- if server/client crashes,
their views of “state” may
be inconsistent, must be
reconciled

HTTP connections

Nonpersistent HTTP

At most one object is sent over
a TCP connection.
HTTP/1.0 uses nonpersistent
HTTP

Persistent HTTP

Multiple objects can be sent
over single TCP connection
between client and server.
HTTP/1.1 uses persistent
connections in default mode

Nonpersistent HTTP

Suppose user enters URL:

http://www.ccnatutorials.com/2016/02/ethernet.html
and it contains text,
references to 10
jpeg images)

1a. HTTP client initiates TCP
connection to HTTP server
(process) at
www.ccnatutorial.com on port 80

1b. HTTP server at host
www.ccnatutorial.com waiting for TCP
connection at port 80.
“accepts” connection, notifying
client

2. HTTP client sends HTTP request
message (containing URL) into TCP
connection socket. Message
indicates that client wants object
2016/02/ethernet.html

3. HTTP server receives request
message, forms response
message containing requested
object, and sends message
into its socket

4. HTTP server closes TCP
connection.

5. HTTP client receives response
message containing html file,
displays html. Parsing html
file, finds 10 referenced jpeg
objects

6. Steps 1-5 repeated for each of
10 jpeg objects

Problems with Nonpersistent HTTP

- A brand new connection must be established and maintained for
each requested object.
- For each of these connections, TCP buffers must be allocated and TCP
variables must be kept in both the client and server.
(Load on server for simultaneous connections!)
- Each object suffers two RTTs – one RTT to establish the TCP connection
and one RTT to request and receive an object.

Response time modeling
Response time modeling

Response time modeling

Definition of RTT:
time to send a small packet to
travel from client to server and
Back.
Response time:
- One RTT to initiate TCP connection
- One RTT for HTTP request and
first few bytes of HTTP response to
return
- File transmission time
total = 2RTT+transmit time








Nonpersistent HTTP issues:

- requires 2 RTTs per object
- OS must work and allocate host
resources for each TCP
connection but browsers often
open parallel TCP connections
to fetch referenced objects

Persistent HTTP

- server leaves connection open
after sending response
- subsequent HTTP messages
between same client/server are
sent over connection

Persistent without pipelining:

- client issues new request only
when previous response has
been received
- one RTT for each referenced
object

Persistent with pipelining:

- default in HTTP/1.1
- client sends requests as soon
as it encounters a referenced
object
- as little as one RTT for all the
referenced objects

HTTP Request Format

HTTP Request Format
HTTP Request Format

HTTP Request Format: GET, HEAD, PUT, POST, DELETE

A small browser request: http://localhost

user@host:~$ telnet localhost 80
Trying ::1...
Connected to localhost.localdomain.
Escape character is '^]'.
GET / HTTP/1.0
HTTP/1.1 200 OK
Date: Thu, 18 Aug 2016 14:46:28 GMT
Server: Apache/2.2.16 (Ubuntu)
Last-Modified: Mon, 08 Aug 2016 10:14:21 GMT
...
Connection: close
Content-Type: text/html
<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
</body></html>
Connection closed by foreign host.

Conditional GET: client-side caching

Conditional GET: client-side caching
Conditional GET: client-side caching

HTTP Respond Format

HTTP Respond Format
HTTP Respond Format
1xx codes: Informational 
2xx codes: Successes 
3xx codes: Redirection
4xx codes: Client error 
5xx codes: Server error

HTTP response status codes

A few sample codes:

200 OK
– request succeeded, requested object later in this message
301 Moved Permanently
– requested object moved, new location specified later in this
message (Location:)
400 Bad Request
– request message not understood by server
404 Not Found
– requested document not found on this server
505 HTTP Version Not Supported

Cookies: keeping “state”

Cookies are an alternative mechanism for sites to keep track of users.
A: The server's response will include a Set-cookie: header.
Often this header line contains an identification number generated by the
Web server.
For example, the header line might be:
Set-cookie: 1678453

B: When the the HTTP client receives the response message, it sees the
Set-cookie: header and identification number.

C: Client appends a line to a special cookie file that is stored in the client
machine and includes the host name of the server and user's associated
identification number.

D: In subsequent requests to the same server, say one week later, the
client includes a Cookie: request header, and this header line specifies the
identification number for that server.

In the current example, the request message includes the header line:
Cookie: 1678453.

E: In this manner, the server does not know the username of the user, but
the server does know that this user is the same user
that made a specific request one week ago!

Many major Web sites use cookies                             Example:

Four components:                                                       – Ahmad.m access Internet
                                                                                        always from same PC
1) cookie header line in the HTTP                                            
response message                                                           – He visits a specific ecommerce
2) cookie header line in HTTP                                          site for first time
request message                                                                                                                         
3) cookie file kept on user’s host and                                – When initial HTTP requests arrives at site,
managed by user’s browser                                                   site creates a unique ID
4) back-end database at Web site                                           and creates an entry in backend database for ID


Cookies: keeping “state”
Cookies: keeping “state”

Cookies and privacy:

- Cookies permit sites to learn a lot about you
- You may supply name and e-mail to sites (Maybe Credentials!)
- Search engines use redirection & cookies to learn yet more
- Advertising companies obtain info across sites






Sunday, August 7, 2016

Ethernet

Ethernet

Ethernet is a standard communications protocol
embedded in software and hardware devices,
intended for building a local area network (LAN)
Ethernet is a contention media access method that
allows all hosts on a network to share the same bandwidth of a
link.
Ethernet is popular because it’s readily scalable,
meaning it’s comparatively easy to integrate new
technologies, such as FastEthernet and Gigabit Ethernet, into
an existing network infrastructure.
Ethernet defines the lower two layers of the OSI Reference
Model
The IEEE divides the data link layer into two sub-layers, the
logical link control (LLC) layer and the media access control
(MAC) layer The MAC layer varies for different network types
and is defined by standards IEEE 802.3 through IEEE 802.5

IEEE 802.3 to ISO

IEEE 802.3 to ISO
IEEE 802.3 to ISO

                              Ethernet's Logical Relationship to the ISO Reference Model

Ethernet Network Topologies and Structures

Ethernet uses a bus or star topology and supports
data transfer rates of 10/100/1000 Mbps
Ethernet Network Topologies and Structures
                                                         Ethernet Network Topologies andStructures

Ethernet networking uses Carrier Sense Multiple Access with
Collision Detection (CSMA/CD), a protocol that helps devices
share the bandwidth evenly without having two devices
transmit at the same time on the network medium.

CSMA/CD

Network access regulated by the CSMA/CD procedure:
Carrier Sense = “listen” to the cable
Multiple Access = all stations can send at the same time
• Collision Detect = collisions must be recognized

MAC Types

There are two Media Access Control(MAC)
protocols defined for Ethernet:
- Half-Duplex
- Full-Duplex

Half-Duplex

Refers to the transmission of data in just one
direction at a time
Half-Duplex Ethernet is the traditional form of
Ethernet that uses the CSMA/CD

Carrier Sense Multiple Access Collision Detect(Half-Duplex)

The network is monitored for presence of a transmitting
station (carrier sense)
Adapter does not transmit if it senses that some other
adapter is transmitting
The transmission is delayed if an active carrier is detected
The station continues to monitor the network until the carrier
stops
If an active carrier is not detected, then the station
immediately begins transmission
While the transmitting station is sending the frame, it
monitors the medium for a collision.
If a collision is detected, the transmitting station stops
sending the frame data
Before attempting a retransmission, adapter waits a
random time, that is, random access
If repeated collisions occur, then transmission
is repeated
But the random delay is increased with each
Attempt
This process repeats until a station transmits a
frame without collision

State Diagram for CSMA/CD

State Diagram for CSMA/CD
State Diagram for CSMA/CD


Full-Duplex

Based on the IEEE 802.3x standard, “Full- Duplex” MAC
type bypasses the CSMA/CD protocol
Full-duplex mode allows two stations to simultaneously
exchange data over a point to point link
The aggregate throughput of the link is effectively
doubled
A full-Duplex 100 Mb/s station provides 200
Mb/s of bandwidth

Use of Full-duplex Ethernet

Full-duplex Ethernet can be used in three situations:
- With a connection from a switch to a host
- With a connection from a switch to a switch
- With a connection from a host to a host using a
crossover cable

Ethernet at the Physical Layer

Ethernet was first implemented by a group called DIX
(Digital, Intel, and Xerox).
They created and implemented the first Ethernet LAN
specification, which the IEEE used to create the IEEE
802.3 Committee.
This was a 10Mbps network that ran on coax, and then
eventually twisted-pair, and fiber physical media.

Ethernet (IEEE802.3) Frames

Ethernet (IEEE802.3) Frames
Ethernet (IEEE802.3) Frames

Preamble

- A sequences of 64 bits used for synchronization
- Detects the presence of a signal
- Begin reading the signal before the frame data
arrives

Destination & Source MAC Addresses

– The Destination MAC Address field identifies
the station or stations that are to receive the
Frame
– The Source MAC Address identifies the station
that originated the frame

Length

- Specifies the length of packet

MAC Client Data

- Contains the data transferred from the source
station to the destination station or stations

Frame Check Sequence

– Contains a 4-byte cyclical redundancy check
(CRC) value used for error checking

Cyclical Redundancy Check

The CRC method operates on blocks of data called
frames.
Basically, the sender appends a bit sequence to every
frame, called the FCS (frame check sequence).
The resulting frame is exactly divisible by a predetermined
number.
The receiving computer divides the frame by the
predetermined number.
If there is a remainder, the frame is considered corrupted
and a retransmission is requested.

Ether net Standards

IEEE 802.1: Standards related to network management
IEEE 802.2: General standard for the data link layer in
the OSI Reference Model
– The IEEE divides this layer into two sublayers
- Logical link control (LLC) layer
- Media Access Control (MAC) layer
– The MAC layer varies for different network types and
is defined by standards IEEE 802.3 through IEEE 802.5

IEEE 802.3: Defines the MAC layer for bus networks that use
CSMA/CD. This is the basis of the Ethernet
Standard IEEE 802.4: Defines the MAC layer for bus
networks that use a token-passing mechanism
(token bus networks)
IEEE 802.5: Defines the MAC layer for token-ring networks
IEEE 802.6: Standard for Metropolitan Area
Networks (MANs)