Computer Networks Course
Computer Networks Course
Iulian ILIE-NEMEDI
inemedi@ie.ase.ro
Evaluation
• Laboratories:
– Test: TCP server for a given protocol (1 point).
– Project: TCP or RMI client-server application for a
given functionality (2 points).
• Exam:
– Closed questions (5 points).
– Exercises (2 points).
• Extra:
– Lecture on computer networks for Cloud (1 point).
References
• Andrew TANENBAUM
– Computer Networks, 5th edition
• http://nemedi.ase.ro
OSI and TCP/IP Model
Objectives
• Discuss the OSI model and its layer
architecture and show the interface
between the layers.
• Briefly discuss the functions of each
layer in the OSI model.
• Introduce the TCP/IP protocol.
• Show the functionality of each layer in
the TCP/IP Model.
• Similarities and comparison between
OSI and TCP/IP Model.
Network Model
Amount=10&B2=Submit
Redirection
• HTTP allows servers to redirect a client request to a different
location. Although, this will usually result in another network
round trip.
301 Permanent redirect – Content move permanently at the location specified by the Location
header and future requests should be directed to this location.
302 Temporary Redirect - future requests should still be sent to the original location
303 This status code was intended to be the only status code that caused a POST to be
converted to a GET. However, most browsers treat a 302 like a 303.
304 Not modified - Used in response to an If-Modified header to redirect a request to the
browser's local cache.
HTTP/1.1 200 OK
Date: Mon, 01 Dec 2008 01:15:39 GMT
Access-Control-Allow-Origin: http://foo.example
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: X-PINGOTHER
Access-Control-Max-Age: 1728000
Multiple resources
Single resource +
Multiple resources Bi-directional
Issue in HTTP
RESPONSE
RESPONSE
Issue in HTTP
Connect-Poll
No data in response
Connect-Poll
Client No data in response Server
Connect-Poll
Data
Server-Sent Events
(Long Polling)
Connect-Poll
Data
Client Server
Poll
Data
Streaming
Connect
Push
Push
Client Push Server
Push
Close Connection
Web Sockets
Method Description
ws.send() The send(data) method transmits data
using the connection.
ws.close() The close() method would be used to
terminate any existing connection.
Web Socket
Object in JavaScript
Programmatic
Endpoints in Java
To deploy this programmatic endpoint, use the following code in your Java EE application:
Annotated
Endpoints in Java
• Statelessness:
– No connection state maintained between REST
invocations.
– Simpler to design and evolve, no side effects, scalable.
• Connectedness:
– Resources should link together in their representations.
• Uniform interface:
– Same set of operations for each resource.
Uniform Interface
• HTTP Methods
GET /users/10123 200 OK
POST /users (representation in request) 201 Created
* Location
PUT /users/10123 (representation in request) 200 OK
DELETE /users/10123 200 OK
HEAD /users/10123
OPTIONS /users/10123
• HTTP Headers:
– Content-Type, Accept, Location.
– Last-Modified, Cache-Control, Etag, … (for caching).
Uniform Interface
• Several HTTP Status Codes:
– 200 OK.
– 201 Created: a resource was created.
– 202 Accepted: the request was accepted for asynchronous
processing.
– 204 No Content: the request was successful, but no content was
returned.
– 400 Bad Request (no more details).
– 404 Not Found.
– 406 Not Acceptable: request’s Accepted ≠ response Content-Type.
– 415 Unsupported Media Type: request Content-Type cannot be
processed.
– 422 Un-processable Entity (HTTP Extension): request is
semantically wrong.
– 500 Internal Server Error: something went really bad on the server.
Safety and Idem-potency
• GET is safe:
– It’s a request to read data, not to change the server state.
– Client feels safe that nothing terrible will happen on the
server.
– Applying them 0, 1, n times => the same server state.
• Use PUT…
– If you can specify the FULL content of the resource you
create/update.
– Creating with PUT = the client knows upfront the URI of the
new resource (id!).
PUT /users/10123 (representation in request) 200 OK
• Use POST…
– If you to create/update one or more subordinates of the
resource.
– Creating with POST = the server generates the URI of the new
resource, returning to the client in the Location response
header.
Content Negotiation
• At resource-level:
– GET /v1/users/123456
• At representation-level:
– Content-Type:
application/vnd.bpost.excell.common.task.v2+xml
{
"errors": [
{
"userMessage": "Sorry, the requested resource does not exist",
"internalMessage": "No car found in the database",
"code": 34,
"more info":
"http://dev.mwaysolutions.com/blog/api/v1/errors/12345"
}
]
}
105
Web Services Architectures
How is the method How is the target
conveyed? identified?
RESTful and HTTP Method URI
Resource-oriented
RPC-like HTTP request Body HTTP request Body
URI query parameter URI
REST-RPC Hybrid HTTP Method + URI
(HTTP + Plain Old Xml) others*
• .NET:
– Windows Communication Foundation (WCF).
<message name="SayHelloRequest">
<part name="firstName" type="xsd:string"/>
</message>
<message name="SayHelloResponse">
<part name="greeting" type="xsd:string"/>
</message>
119
Message Exchange Patterns
122
WSDL SOAP Bindings
• The soap:binding element indicates a SOAP binding over HTTP
transport:
– The style attribute indicates rpc for an RPC format or document
for a document-oriented message format.
– The transport attribute defines the transport mechanism.
• The soap:operation element indicates the binding of a specific
operation to a SOAP implementation:
– The soapAction attribute specifies that the SOAPAction HTTP
header should be used for identifying the service (SOAP 1.1 only).
• The soap:body element specifies the details of the input and
output messages:
– The encodingStyle attribute defines the encoding format when
the use attribute is encoded (RPC encoded) and the namespace
attribute defines the RPC message namespace.
– For document/literal messaging, the use attribute is literal.
123
Using WSDL
• Most Web service development toolkits support
WSDL:
– Generate WSDL from server (interface) code.
– Translate WSDL to server objects and client
proxies.
• Dynamic invocation obtains the WSDL, select an
operation, populate the parameters and send the
request message:
– Generic SOAP client: soapUI
http://www.soapclient.com/soaptest.html
124
soapUI Demo
125
SOAP Message
126
SOAP Request Message
127
SOAP Response Message
128
SOAP With MTOM Attachments
• Raw binary data can be transported in a SOAP message as
base64.
• MTOM (Message Transmission Optimization Mechanism)
using MIME attachments to carry binary data with a SOAP
message:
– Supports embedding of type and other information.
– Allows streaming (attachments produced on demand).
– Example HTTP header for SOAP with MTOM:
POST / HTTP/1.1
Host: www.example.com
Content-Type: multipart/related;
boundary=”mimeboundary";
type="application/xop+xml";
start="<soapmsg>";
start-info="application/soap+xml;
charset=utf-8"
129
SOAP With MTOM Attachments
• Example HTTP body with SOAP message and MTOM attachment:
--mimeboundary
Content-Type: application/xop+xml;charset=utf-
8;type=application/soap+xml
Content-Transfer-Encoding: binary
Content-ID: <soapmsg>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=”…”
xmlns:xop="http://www.w3.org/2004/08/xop/include"
xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
<SOAP-ENV:Body>
<m:PutImage xmlns:m="http://www.example.com/test.wsdl">
<m:data xmlmime:contentType=”image/jpeg">
<xop:Include href="cid:image"/>
</m:data>
</m:PutImage>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--mimeboundary
Content-Type: image/jpeg
Content-Transfer-Encoding: binary
Content-ID: <image>
… image data …
--mimeboundary--
130
WS-Addressing
• WS-Addressing is a Web services protocol for routing
messages (request, response, and faults).
• Supports message transmission through networks with
processing nodes such as endpoint managers, firewalls, and
gateways:
<S:Envelope
xmlns:S="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<S:Header>
<wsa:MessageID>
uuid:6B29FC40-CA47-1067-B31D-00DD010662DA
</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://business456.example/client1</wsa:Address>
</wsa:ReplyTo>
<wsa:To>http://fabrikam123.example/Purchasing</wsa:To>
<wsa:Action>http://fabrikam123.example/SubmitPO</wsa:Action>
</S:Header>
<S:Body>
...
</S:Body>
</S:Envelope>
131
WS-Addressing
• WS-Addressing header elements within the SOAP Header:
– <wsa:MessageID> xs:anyURI </wsa:MessageID>
defines a unique message ID, e.g. UUID (optional).
– <wsa:RelatesTo RelationshipType="..."?> xs:anyURI </wsa:RelatesTo>
conveys the message ID of the related message, e.g. the request
message ID when this is a reply message (required for responses).
– <wsa:To> xs:anyURI </wsa:To>
the destination address (required).
– <wsa:Action> xs:anyURI </wsa:Action>
conveys the SOAP action property (required).
– <wsa:From> endpoint-reference </wsa:From>
the source endpoint information (optional).
– <wsa:ReplyTo> endpoint-reference </wsa:ReplyTo>
the reply endpoint (required for request with an expected reply).
– <wsa:FaultTo> endpoint-reference </wsa:FaultTo>
the fault endpoint (optional).
132
WS-Addressing
133
WS-Security
135
Security Timestamps
• A timestamp can be included to define the lifetime of a message.
• The timestamp will only be tamper proof when digitally signed,
hence the wsu:Id which is referenced by the signature info:
<SOAP-ENV:Envelope …>
<SOAP-ENV:Header>
<wsse:Security>
<wsu:Timestamp wsu:Id="timestamp">
<wsu:Created>2001-09-13T08:42:00Z</wsu:Created>
<wsu:Expires>2001-10-13T09:00:00Z</wsu:Expires>
</wsu:Timestamp>
...
</wsse:Security>
...
</SOAP-ENV:Header>
<SOAP-ENV:Body>
...
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
136
Signatures
• The wsse:BinarySecurityToken contains the public key.
• The ds:Signature element contains signature info with digest value for
each signed message part and the signature value:
<wsse:Security>
<wsse:BinarySecurityToken wsu:Id=“X509Token” …>
public key
</wsse:BinarySecurityToken>
<ds:Signature>
<ds:SignedInfo>
what is signed: reference URI to signed part with digest of that XML message part
how it is signed: digests algorithms and canonicalization of XML
</ds:SignedInfo>
<ds:SignatureValue>
signature
</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference>
<wsse:Reference URI="#X509Token"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
137
List of WS-* Protocols
• Messaging:
– SOAP.
– SOAP with Attachments (SwA).
– SOAP with MTOM (Message Transmission Optimization
Mechanism).
– XML-RPC: a simpler XML RPC format (no WSDL or schemas).
– WS-Addressing: routing, endpoints, and addressing properties.
• Service description:
– WSDL.
– WS-MetadataExchange: how an endpoint can request the
various types of metadata it may need to effectively
communicate with the service.
– WS-Policy: describes the capabilities, requirements, and
general characteristics of a service.
138
List of WS-* Protocols
• Directory access and discovery:
– UDDI (Universal Description, Discovery, and Integration) v2/v3.
– WS-Discovery: a multicast discovery protocol to locate services on a
network.
• Managing services:
– WS-Management: for management of servers, devices, applications.
• Transaction-based services:
– WS-Transaction: describes the coordination types atomic transaction
(TA) and business activity (BA).
• Publish/subscribe:
– WS-Eventing.
– WS-Notification.
• Security and reliability:
– HTTPS (transport-level).
– WS-Security (message-level).
– WS-ReliableMessaging.
139
Other Notable WS-* Protocols
• Managing resources: Web Services Resource Framework (WSRF):
– WS-ResourceProperties: defines are resource’s properties.
– WS-ResourceLifetime: inspect and monitor the lifetime of a resource.
– WS-ServiceGroup: defines how resources are grouped together for a domain.
specific purpose (service classification and constraints).
– WS-BaseFaults: defines faults related to resource management.
• Managing resources:
– WS-Transfer: operations for sending and receiving the representation of a
given resource and operations for creating and deleting a resource.
• Best practices:
– Provide additional information to improve interoperability between vendor
implementations.
– WS-I Basic profile (BP1.0a, BP1.1).
– WS-I Basic security profile.
140
Other Notable WS-* Protocols
• Device Profile for Web Services (DPWS):
– Goals similar to universal plug and play (UPnP).
– Seamless integration and discovery of devices over the
Internet:
• Printing, scanning, etc. over Internet by discovering these
services.
• Uploading images from camera to PC over the (wireless) Internet.
– Microsoft Vista natively integrates DPWS.
• Builds on:
– WS-Eventing (publish/subscribe).
– WS-Discovery.
– WS-Addressing.
– WS-Security.
– WS-Policy.
– WS-MetaExchange.
141
Frameworks for Web Services
Framework Platform Specifications Protocols
Apache Axis2 Java WS-ReliableMessaging, WS-Security, WS- SOAP1.1, SOAP1.2,
AtomicTransaction, WS-Addressing, MTOM, MTOM, WSDL 2.0,
WS-Policy, WS-MetadataExchange
WSDL, REST
Apache CXF Java WS-ReliableMessaging, WS-Security, WS- SOAP1.1, SOAP1.2,
Addressing, MTOM, WS-Policy, WS- MTOM, WSDL 2.0,
SecureConversation, WS-SecurityPolicy, WS-
WSDL, REST
Trust
1. SMTP is used to
accept the mail from
sender client;
2. SMTP is used to
deliver the mail to
receiver server;
3. POP, IMAP or
Webmail are used to
download the mail to
receiver client from
the receiver server.
POP
Post Office Protocol
• Protocol for receiving e-mail;
• Client – server protocol;
• Achieves transparent connection between email server and
e-mail client;
• Store-and-forward service;
• Listens on well-known port 110;
• Similar to SMTP command – reply lockstep protocol;
• Used to retrieve mail for a single user;
• Requires authentication;
• Commands and replies are ASCII lines;
• Replies start with “+OK” or “-ERR”;
• Replies may contain multiple lines.
Commands
• You can read your mail without being logged onto the
Internet;
• You may compose new messages to send to others without
being logged onto the Internet;
• Opening attachments is a quick and painless;
• There is not a maximum size on your mailbox;
• There is no advertising when you read your email;
• All messages are stored on your hard drive.
Disadvantages of POP
Initialization
Connect
Logout
Non-Authenticated
Logout, Close
Preauth
Login
Logout
Authenticated
Select Close
Logout
Selected
Flags Message Attributes
• List of token associated with the message that is sent by
the server;
• A flag can be permanent or session-only;
• Types:
– System flag:
• Flag name that is pre-defined in the IMAP
specification;
• All system flags begin with ‘\’.
– Keywords:
• A keyword is defined by the server implementation;
• Keywords do not begin with ‘\’.
Flags Message Attributes
• \Seen (Message has been read);
• \Answered (Message has been answered);
• \Flagged (Message is "flagged" for urgent/special
attention);
• \Deleted (Message is "deleted" for removal by later
EXPUNGE);
• \Draft (Message has not completed composition
marked as a draft);
• \Recent (Message is "recently" arrived in this
mailbox. This session is the first session to have been notified
about this message).
Commands
Conversion Multiplexing
• Segmenting the data into smaller
chunks enables many different
communications, from many
different users, to be interleaved
(multiplexed) on the same
network;
• The transport layer adds a
header that contains binary data
to identify each segment of data
and to enable various transport
layer protocols to perform
different functions in the
management of data
communication.
Transport Layer Role
Reliability
• The transport layer is also responsible for managing reliability;
• Some applications may not require reliability. Transport layer requirements
vary from application to application;
• TCP/IP suite provides two transport
layer protocols, Transmission Control
Protocol (TCP) and User Datagram
Protocol (UDP);
• IP uses these transport protocols to
enable hosts to communicate and
transfer data;
• TCP is considered a reliable,
full-featured transport layer protocol,
which allows for packet data delivery
confirmation;
• In contrast, UDP is a very simple
transport layer protocol that does not
provide any reliability.
Transmission Control Protocol
• TCP transport is reliable because it supports packet delivery
confirmation;
• There are three basic operations that enable reliability with TCP:
• Numbering and tracking data segments transmitted to a
specific host from a specific application;
• Acknowledging received data;
• Retransmitting any unacknowledged
data after a certain period of time.
TCP Features
• Source Port:
• The source port number is dynamically chosen by the sending
device to identify a conversation between two devices;
• An HTTP client usually sends multiple HTTP requests to a web
server at the same time. Each separate HTTP conversation is
tracked based on the source ports.
• Destination Port:
• Used to identify an application
or service running in the server;
• A server can offer more than one
service at the same time, offering
a web service on port 80 and
FTP on port 21 simultaneously.
Port Ranges
Port Numbers
The Internet
Assigned Numbers
Authority (IANA) is
the standards body Well-Known Port Numbers
responsible for
assigning various
addressing
standards, including
port numbers.
Sockets
• The combination of the source IP address and source port number, or the
destination IP address and destination port number, is known as a socket;
• The socket is used to identify the server and service being requested by the
client;
• Two sockets combine to form a socket pair: (192.168.1.5:1099,
192.168.1.7:80);
• Sockets enable multiple processes
running on a client and multiple
connections to a server process to
be distinguished from each other.
• The source port number acts as a
return address for the requesting
application;
• It is the transport layer’s job to keeps
track of active sockets.
netstat Tool
• UDP does not track sequence numbers the way TCP does;
• UDP has no way to reorder the datagrams into their transmission order;
• UDP simply reassembles
the data in the order in which
it was received;
• The application must identify
the proper sequence, if
necessary.
UDP Servers
Customer’s equipment
fig 5-1
A B
Q
Description of Routing Algorithms
• Fairness and optimality may sound obvious, but as it turns out, they
are often contradictory goals;
• There is enough traffic between A and A', between B and B', and
between C and C' to saturate the horizontal links. To maximize the total
flow, the X to X' traffic should be shut off altogether. Unfortunately, X
and X' may not see it that way. Evidently, some compromise between
global efficiency and fairness to individual connections is needed.
Description of Routing Algorithms
I J
K
The Optimal Principle
Part (a) shows a subnet. The first four columns of part (b)
show the delay vectors received from the neighbors of router
J. Suppose that J has measured or estimated its delay to its
neighbors, A, I, H, and K as 8, 10, 12, and 6 msec., respectively.
Link State Routing
(a) A subnet. (b) The link state packets for this subnet
Link State Routing
• Building the link state packets is easy. The hard part is determining
when to build them. One possibility is to build them periodically, that
is, at regular intervals. Another possibility is to build them when some
significant event occurs, such as a line or neighbor going down or
coming back up again or changing its properties appreciably.
• Distributing the Link State Packets:
– The basic distribution algorithm: The fundamental idea is to use flooding
to distribute the link state packets. To keep the flood in check, each
packet contains a sequence number that is incremented for each new
packet sent. Routers keep track of all the (source router, sequence) pairs
they see. When a new link state packet comes in, it is checked against the
list of packets already seen. If it is new, it is forwarded on all lines except
the one it arrived on. If it is a duplicate, it is discarded. If a packet with a
sequence number lower than the highest one seen so far ever arrives, it is
rejected as being obsolete since the router has more recent data.
Link State Routing
• The routers are divided into what we will call regions, with
each router knowing all the details about how to route
packets to destinations within its own region, but knowing
nothing about the internal structure of other regions;
• For huge networks, a two-level hierarchy may be
insufficient; it may be necessary to group the regions into
clusters, the clusters into zones, the zones into groups, and
so on, until we run out of names for aggregations.
Hierarchical Routing
• Multi-destination routing;
• If this method is used, each packet contains either a list of
destinations or a bit map indicating the desired
destinations. When a packet arrives at a router, the router
checks all the destinations to determine the set of output
lines that will be needed. (An output line is needed if it is
the best route to at least one of the destinations.) The
router generates a new copy of the packet for each output
line to be used and includes in each packet only those
destinations that are to use the line. In effect, the
destination set is partitioned among the output lines. After
a sufficient number of hops, each packet will carry only one
destination and can be treated as a normal packet.
Broadcast Routing
Reverse path forwarding. (a) A subnet. (b) A sink tree. (c) The
tree built by reverse path forwarding.
The Network Layer in the Internet
• The IP Protocol;
• IP Addresses;
• Internet Control Protocols.
The IP Protocol
network mask
255.0.0.0
255.255.0.0
255.255.255.0
IP Addresses
• The values 0 and -1 (all 1s) have special meanings. The value 0
means this network or this host. The value of -1 is used as a
broadcast address to mean all hosts on the indicated network.
IP Addresses
• All the hosts in a network must have the same network number.
This property of IP addressing can cause problems as networks
grow;
• The problem is the rule that a single class A, B, or C address
refers to one network, not to a collection of LANs;
• The solution is to allow a network to be split into several parts
for internal use but still act like a single network to the outside
world.
IP Addresses
Hardware
Type - Ethernet
is type 1
Protocol Type-
IPv4=x0800
Hardware
Length:length of
Ethernet
Address (6)
Protocol
Length:length of
IPv4 address (4)
Encapsulation of ARP Packet
• If entry not found, module creates a new entry. State is set to RESOLVED and
TIME-OUT is set;
• Now the module checks to see if arrived ARP packet is a Request. If it is, the
module immediately creates an ARP Reply message and sends it back to
sender;
• The cache-control module periodically checks each cache entry
• If entry’s state is FREE, skips it
• If entry’s state is PENDING, Attempts field is incremented by 1. This value
greater than max? Toss this entry (and mark entry as FREE). Less than max?
Send another ARP request;
• If state of entry is RESOLVED, module decrements value of Time-out field
accordingly
• If Time-out field < 0, then remove entry and set state to FREE.
Reverse Address
Resolution Protocol
• RARP finds the logical address for a machine that only knows its
physical address;
• This if often encountered on thin-client workstations. No disk, so
when machine is booted, it needs to know its IP address (don’t want to
burn the IP address into the ROM);
• RARP requests are broadcast, RARP replies are unicast;
• If a thin-client workstation needs to know its IP address, it probably
also needs to know its subnet mask, router address, DNS address, etc.;
• So we need something more than RARP. BOOTP, and now DHCP have
replaced RARP.
Reverse Address
Resolution Protocol
RARP Packet
Encapsulation of RARP Packet
Internet Group
Management Protocol
Internet Group
Management Protocol
• IGMP is a protocol that manages group membership. The IGMP
protocol gives the multicast routers information about the
membership status of hosts (routers) connected to the network;
• IGMP is a group management protocol. It helps a multicast
router create and update a list of loyal members related to each
router interface.
IGMP Message Format
IGMP Operation
• In IGMP, a membership
report is sent twice, one
after the other.
General Query Message
Encapsulation
• Insufficiency:
– Only four bytes;
– Maximum nodes ~ 4.3 billion;
– Much less than the human population (~ 7 billion);
– Not enough for growing number of users;
– Will be exhausted in near future.
• Increasing routing information:
– Rapid growth of routing tables in backbones.
• Increasing the number of Network Address Translation:
– Breaking the Internet architecture.
Problems of IPv4
• Security issues:
– Number of ways to encrypt IPv4 traffic (example: IPSec);
– No real standard encryption method.
• Real-time delivery of multimedia content and necessary
bandwidth allocation:
– Quality of Service (QoS);
– Different interpretations;
– QoS compliant devices are not compatible one another.
Routing Private Addresses
in IPv4 Using NAT
Representation:
• 16-bit hexadecimal numbers;
• Numbers are separated by (:);
• Abbreviations are possible:
– Leading zeros in contiguous block could be represented
by (::);
– Example:
• 2001:0db8:0000:130F:0000:0000:087C:140B
• 2001:0db8:0:130F::87C:140B
– Double colon only appears once in the address.
Addressing Format
Prefix Representation:
• Representation of prefix is just like CIDR (Classless
InterDomain Routing);
• In this representation you attach the prefix length;
• Like v4 address:
– 198.10.0.0/16.
• V6 address is represented the same way:
– 2001:db8:12::/48.
• Only leading zeros are omitted. Trailing zeros are not
omitted:
– 2001:0db8:0012::/48 = 2001:db8:12::/48
2001:db8:1200::/48 ≠ 2001:db8:12::/48
Address Representation
• Unicast:
– Address of a single interface;
– One-to-one delivery to single interface.
• Multicast:
– Address of a set of interfaces;
– One-to-many delivery to all interfaces in the set.
• Anycast:
– Address of a set of interfaces;
– One-to-one-of-many delivery to a single interface in the
set that is closest.
• No more broadcast addresses.
Types of IPv6 Addresses
IPv6 Unicast
Site-Level
Aggregation
• Private Addresses:
– Called local-use addresses or link-layer addresses;
– No NATs;
– So local-use addresses are intended for communication
inherently designed only to be sent to local devices.
• Loopback Address:
– A special loopback address for testing;
– Datagrams sent to this address loops-back to the sending
device;
– The loopback address is 0:0:0:0:0:0:0:1 or as ::1;
– Ping ::1 should answer myself.
IPv6 Multicast
IPv6 Site
Transition Plan
• Current status:
– Only IPv4.
• Phase I:
– IPv4/v6 dual node;
– IPv4 address in IPv6 address format;
– IPv6 tunneling on the IPv4 network.
• Phase II:
– Combination of IPv6 infrastructure and IPv4
infrastructure;
– Translate between IPv4/v6 each other (optional);
– More IPv6 nodes.
Migration to IPv6
• Dual Stack:
– Involves running IPv4 and IPv6 at the same time;
– End nodes and routers/switches run both protocols.
• Tunnel:
– To carry one protocol inside another;
– Take IPv6 packets and encapsulate them in IPv4 packets
to be sent across portions of the IPv4 networks.
• Translator:
– Protocol translation (NAT-PT) simply translate IPv6
packets into IPv4 packets.
IPv6 Advantages
Class Default Subnet Mask Number of Networks Number of Hosts per Network
A 255.0.0.0 256 16,777,216
B 255.255.0.0 65,536 65,534
C 255.255.255.0 16,777,216 126
Class Inter Domain Routing (CIDR)
• This refers to the method used by ISPs to provide /
allocate a number of IP addresses to their clients:
– e.g. 192.168.1.0/28
• The /28 refers to the number of bits that are turned on
(there are 32 bits in an IP Address, with 4 octets, hence 8
bits per octet);
• A class A address has a subnet mask of 255.0.0.0. This
means that all the bits in the first byte have been turned
on. To achieve the slash function, count the number of
turned on bits in the mask.
• The 255.0.0.0 is considered a /8 since only 8 bits are 1’s.
CIDR Examples
• Consider a class B subnet mask of 255.255.0.0, what is
its CIDR Value?
• Calculate the subnet masks of the following CIDR Values.
/9,/10,/13,/16,/21,/22,/23,/25,/26,/27,/28,/29,/30
In a class C network, there are only 8 bits in the host part. The table
below shows all the subnets in class C networks. We can’t use a /31 or /32
because, as I’ve said, we must have at least 2 host bits for assigning IP
addresses to hosts.