Naming - PowerPoint PPT Presentation

1 / 43
About This Presentation
Title:

Naming

Description:

cicada.cs.princeton.edu. princeton.edu, 128.196.128.233. cicada.cs.princeton.edu ... cicada.cs.princeton.edu. cs.princeton.edu, 192.12.69.5. 2. 3. 4. 5. 6. 7 ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 44
Provided by: klp18
Category:
Tags: cicada | naming

less

Transcript and Presenter's Notes

Title: Naming


1
Naming
  • Outline
  • Terminology
  • Domain Naming System
  • Distributed File Systems

2
Overview
  • What do names do?
  • identify objects
  • help locate objects
  • define membership in a group
  • specify a role
  • convey knowledge of a secret
  • Name space
  • defines set of possible names
  • consists of a set of name to value bindings

3
Properties
  • Names versus addresses
  • Location transparent versus location-dependent
  • Flat versus hierarchical
  • Global versus local
  • Absolute versus relative
  • By architecture versus by convention
  • Unique versus ambiguous

4
Examples
  • Hosts
  • cheltenham.cs.princeton.edu 192.12.69.17
  • 192.12.69.17 8023A8335B9F
  • Files
  • /usr/llp/tmp/foo (server, fileid)
  • Users
  • Larry Peterson llp_at_cs.princeton.edu

5
Examples (cont)
  • Mailboxes
  • Services
  • nearby ps printer with short queue and 2MB

6
Domain Naming System
  • Hierarchy
  • Name
  • chinstrap.cs.princeton.edu

7
Name Servers
  • Partition hierarchy into zones

edu
com
gov
mil
org
net
uk
fr










princeton
mit
cisco
yahoo
nasa
nsf
arpa
navy
acm
ieee
cs
ee
physics
ux01
ux04
  • Each zone implemented by two or more name servers

8
Resource Records
  • Each name server maintains a collection of
    resource records
  • (Name, Value, Type, Class, TTL)
  • Name/Value not necessarily host names to IP
    addresses
  • Type
  • NS Value gives domain name for host running name
    server that knows how to resolve names within
    specified domain.
  • CNAME Value gives canonical name for particle
    host used to define aliases.
  • MX Value gives domain name for host running mail
    server that accepts messages for specified
    domain.
  • Class allow other entities to define types
  • TTL how long the resource record is valid

9
Root Server
  • (princeton.edu, cit.princeton.edu, NS, IN)
  • (cit.princeton.edu, 128.196.128.233, A, IN)
  • (cisco.com, thumper.cisco.com, NS, IN)
  • (thumper.ciscoe.com, 128.96.32.20, A, IN)

10
Princeton Server
  • (cs.princeton.edu, optima.cs.princeton.edu, NS,
    IN)
  • (optima.cs.princeton.edu, 192.12.69.5, A, IN)
  • (ee.princeton.edu, helios.ee.princeton.edu, NS,
    IN)
  • (helios.ee.princeton.edu, 128.196.28.166, A, IN)
  • (jupiter.physics.princeton.edu, 128.196.4.1, A,
    IN)
  • (saturn.physics.princeton.edu, 128.196.4.2, A,
    IN)
  • (mars.physics.princeton.edu, 128.196.4.3, A, IN)
  • (venus.physics.princeton.edu, 128.196.4.4, A, IN)

11
CS Server
  • (cs.princeton.edu, optima.cs.princeton.edu, MX,
    IN)
  • (cheltenham.cs.princeton.edu, 192.12.69.60, A,
    IN)
  • (che.cs.princeton.edu, cheltenham.cs.princeton.edu
    , CNAME, IN)
  • (optima.cs.princeton.edu, 192.12.69.5, A, IN)
  • (opt.cs.princeton.edu, optima.cs.princeton.edu,
    CNAME, IN)
  • (baskerville.cs.princeton.edu, 192.12.69.35, A,
    IN)
  • (bas.cs.princeton.edu, baskerville.cs.princeton.ed
    u, CNAME, IN)

12
Name Resolution
  • Strategies
  • forward
  • iterative
  • recursive
  • Local server
  • need to know root at only one place (not each
    host)
  • site-wide cache

13
Distributed File Systems
  • No Transparency
  • Global AFS /cs.princeton.edu/usr/llp/tmp/foo
  • Windows f/usr/llp/tmp/foo
  • Transparency by Convention
  • NFS /usr/llp/tmp/foo
  • Or Not /n/fs/fac5/llp/tmp/foo
  • Transparency by Architecture
  • Sprite /usr/llp/tmp/foo
  • Private versus Shared
  • ASF /usr/llp/tmp/foo versus /afs/shared

14
Stupid Naming Tricks
  • Symbolic links
  • Mount points
  • Union mounts
  • Per-User name spaces
  • Logical name spaces
  • Computed directories

15
Multimedia
  • Outline
  • Compression
  • RTP
  • Scheduling

16
Compression Overview
  • Encoding and Compression
  • Huffman codes
  • Lossless
  • data received data sent
  • used for executables, text files, numeric data
  • Lossy
  • data received does not ! data sent
  • used for images, video, audio

17
Lossless Algorithms
  • Run Length Encoding (RLE)
  • example AAABBCDDDD encoding as 3A2B1C4D
  • good for scanned text (8-to-1 compression ratio)
  • can increase size for data with variation (e.g.,
    some images)
  • Differential Pulse Code Modulation (DPCM)
  • example AAABBCDDDD encoding as A0001123333
  • change reference symbol if delta becomes too
    large
  • works better than RLE for many digital images
    (1.5-to-1)

18
Dictionary-Based Methods
  • Build dictionary of common terms
  • variable length strings
  • Transmit index into dictionary for each term
  • Lempel-Ziv (LZ) is the best-known example
  • Commonly achieve 2-to-1 ration on text
  • Variation of LZ used to compress GIF images
  • first reduce 24-bit color to 8-bit color
  • treat common sequence of pixels as terms in
    dictionary
  • not uncommon to achieve 10-to-1 compression (x3)

19
Image Compression
  • JPEG Joint Photographic Expert Group (ISO/ITU)
  • Lossy still-image compression
  • Three phase process
  • process in 8x8 block chunks (macroblock)
  • greyscale each pixel is three values (YUV)
  • DCT transforms signal from spatial domain into
    and equivalent signal in the frequency domain
    (loss-less)
  • apply a quantization to the results (lossy)
  • RLE-like encoding (loss-less)

20
Quantization and Encoding
  • Quantization Table
  • 3 5 7 9 11 13 15 17
  • 5 7 9 11 13 15 17 19
  • 7 9 11 13 15 17 19 21
  • 9 11 13 15 17 19 21 23
  • 11 13 15 17 19 21 23 25
  • 13 15 17 19 21 23 25 27
  • 15 17 19 21 23 25 27 29
  • 17 19 21 23 25 27 29 31
  • Encoding Pattern

21
MPEG
  • Motion Picture Expert Group
  • Lossy compression of video
  • First approximation JPEG on each frame
  • Also remove inter-frame redundancy

22
MPEG (cont)
  • Frame types
  • I frames intrapicture
  • P frames predicted picture
  • B frames bidirectional predicted picture
  • Example sequence transmitted as I P B B I B B

23
MPEG (cont)
  • B and P frames
  • coordinate for the macroblock in the frame
  • motion vector relative to previous reference
    frame (B, P)
  • motion vector relative to subsequent reference
    frame (B)
  • delta for each pixel in the macro block
  • Effectiveness
  • typically 90-to-1
  • as high as 150-to-1
  • 30-to-1 for I frames
  • P and B frames get another 3 to 5x

24
RTP
  • Application-Level Framing
  • Data Packets
  • sequence number
  • timestamp (app defines tick)
  • Control Packets (send periodically)
  • loss rate (fraction of packets received since
    last report)
  • measured jitter

25
Real-Time Scheduling
  • Priority
  • Earliest Deadline First (EDF)
  • Rate Monotonic (RM)
  • Proportional Share
  • with feedback
  • with adjustments for deadlines

26
Elements of a Protocol Implementation
  • Outline
  • Service Interface
  • Process Model
  • Common Subroutines
  • Example Protocol

27
Socket API
  • Creating a socket
  • int socket(int domain, int type, int protocol)
  • domain PF_INET, PF_UNIX
  • type SOCK_STREAM, SOCK_DGRAM
  • Passive Open (on server)
  • int bind(int socket, struct sockaddr addr, int
    addr_len)
  • int listen(int socket, int backlog)
  • int accept(int socket, struct sockaddr addr, int
    addr_len)

28
Sockets (cont)
  • Active Open (on client)
  • int connect(int socket, struct sockaddr addr,
  • int addr_len)
  • Sending/Receiving Messages
  • int send(int socket, char msg, int mlen, int
    flags)
  • int recv(int socket, char buf, int blen, int
    flags)

29
Protocol-to-Protocol Interface
  • Configure multiple layers
  • static versus extensible
  • Process Model
  • avoid context switches
  • Buffer Model
  • avoid data copies

30
Configuration
  • nametulip
  • nameeth protocolstulip
  • namearp protocolseth
  • nameip protocolseth,arp
  • nameicmp protocolsip
  • nameudp protocolsip
  • nametcp protocolsip

31
Protocol Objects
  • Active Open
  • Sessn xOpen(Protl hlp, Protl llp,
  • Part participants)
  • Passive Open
  • XkReturn xOpenEnable(Protl hlp,Protl llp,
  • Part participant)
  • XkReturn xOpenDone(Protl hlp,
  • Protl llp,Sessn session,
  • Part participants)
  • Demultiplexing
  • XkReturn xDemux(Protl hlp, Sessn lls,
  • Msg message)

32
Session Objects
  • Local end-point of a channel
  • Interpret messages and maintain channel state
  • Export operations for sending and receiving
    messages
  • Operations
  • send a message
  • XkReturn xPush(Sessn lls,Msg message)
  • deliver a message
  • XkReturn xPop(Sessn hls, Sessn lls,
  • Msg message,void hdr)

33
Process Model
Process-per-Protocol
Process-per-Message
34
Message Library
  • Add header
  • Strip header

35
Message Library (cont)
  • Fragment message
  • Reassemble messages

m
m1
m2
abcd
efg
msgFragment
(
m
,
new
, 3)
msgReassemble(new, m1, m2)
new
m
new
defg
abc

36
Event Library
  • Scheduling Timeouts Book-keeping activity
  • Operations
  • Event evSchedule(EvFunc function,
  • void argument,
  • int time)
  • EvCancelReturn evCancel(Event event)

37
Map Library
  • Demultiplex Packets
  • Operations
  • Map mapCreate(int number,int size)
  • Binding mapBind(Map map,
  • void key,
  • void id)
  • XkReturn mapResolve(Map map,
  • void key,void id)

38
Example
  • static Sessn
  • aspOpen(Protl self, Protl hlp, Part p)
  • Sessn asp_s
  • Sessn lls
  • ActiveId key
  • ProtlState pstate (ProtlState
    )self-gtstate
  • bzero((char )key, sizeof(key))
  • / High level protocol must specify both /
  • / local and remote ASP port /
  • key.localport ((AspPort ) partPop(p0))
  • key.remoteport ((AspPort ) partPop(p1))
  • / Assume failure until proven otherwise /
  • asp_s XK_FAILURE

39
  • / Open session on low-level protocol /
  • lls xOpen(self, xGetDown(self, 0), p)
  • if ( lls ! XK_FAILURE )
  • key.lls lls
  • / Check for session in active map /
  • if (mapResolve(pstate-gtactivemap, key,
  • (void )asp_s) XK_FAILURE)
  • / Session not in map initialize it /
  • asp_s asp_init_sessn(self, hlp, key)
  • if ( asp_s ! XK_FAILURE )
  • / A successful open /
  • return asp_s
  • / Error has occurred /

40
  • static XkReturn aspPush(Sessn s, Msg msg)
  • SessnState sstate
  • AspHdr hdr
  • void buf
  • / create a header /
  • sstate (SessnState ) s-gtstate
  • hdr sstate-gthdr
  • hdr.ulen msgLen(msg) HLEN
  • / attach header and send /
  • buf msgAddrHdr(msg, HLEN)
  • aspHdrStore(hdr, buf, HLEN, msg)
  • return xPush(xGetDown(s, 0), msg)

41
  • static XkReturn aspDemux(Protl self, Sessn lls,
    Msg msg)
  • AspHdr h
  • Sessn s
  • ActiveId activeid
  • PassiveId passiveid
  • ProtlState pstate
  • Enable e
  • void buf
  • pstate (ProtlState )self-gtstate
  • / extract the header from the message /
  • buf msgStripHdr(msg, HLEN)
  • aspHdrLoad(h, buf, HLEN, msg)
  • / construct a demux key from the header /
  • bzero((char )activeid, sizeof(activeid))
  • activeid.localport h.dport

42
  • / see if demux key is in the active map /
  • if (mapResolve(pstate-gtactivemap, activeid,
  • (void )s) XK_FAILURE)
  • / didn't find an active session, /
  • / so check passive map /
  • passiveid h.dport
  • if (mapResolve(pstate-gtpassivemap,
    passiveid,
  • (void )e) XK_FAILURE)
  • / drop the message /
  • return XK_SUCCESS
  • / port was enabled, so create a new /
  • / session and inform hlp /
  • s asp_init_sessn(self, e-gthlp,
    activeid)
  • xOpenDone(e-gthlp, s, self)

43
  • static XkReturn
  • aspPop(Sessn s, Sessn ds, Msg msg, void inHdr)
  • AspHdr h (AspHdr ) inHdr
  • / truncate message to length shown in header
    /
  • if ((h-gtulen - HLEN) lt msgLen(msg))
  • msgTruncate(msg, (int) h-gtulen)
  • / pass message up the protocol stack /
  • return xDemux(xGetUp(s), s, msg)
Write a Comment
User Comments (0)
About PowerShow.com