Docstoc

.net

Document Sample
.net Powered By Docstoc
					Lesson: 4        61
1. Which are two different categories of type in C#?
Ans: There are two different categories of type in C# are – [i.] Value type [ii.] Reference type.
1) Value types: - They directly contain data.→ The variable have their own copy of the data.→ A variable of a type always stores
a data value of that type.→ Assignment to a value type variable creates a copy of the value being assigned.→ Some examples of
the Value type are – char, int, float.
 2) Reference types: - The Reference type does not contain data but they contain a reference to the variables, which are stored in
memory. → Using more than one variables, we can use reference types to refer to a memory location. → This means that if
the value in the memory location is modified by one of the variables, the other variables automatically reflect the changed value.
→ In reference type, it is possible for a data to reference an object of other derived type.→ Assignment to a reference type
variable, copies the address of object.→ Some examples of Reference type are – class, string, interface, array, delegate type.

2. What are variables? How many categories of variables are there in C#? Define each.
Ans: A variable is a location in the memory that has a name and contains a value. The Value could be an integer, decimal,
character, string. A variable is associated with a data type that defines the type of data, which can be stored in a variable.
Variables can be initially assigned or initially not assigned. In C# variables are categorized in 7 categories they are:
i) Static variables: - A variable declared with the static modifier is called a static variable. There will be only one copy of the
variable, regardless of how many instances of class are created. ii) Instance variables: - A variables declared without the static
modifiers are instance variables. iii) Array elements: - The array is a container that has a list of storage locations for a specified
type. The elements for a specified type of an array come into existence when an array instance is created, and exist until there
are no references to that array instance. iv) Value parameters: - Parameters are arguments passed to the function. A parameter
declared without a ref or out modifier is a value parameter. A value parameter exists until the function returns. v) Reference
parameters: - A parameter declared with a ref modifier is a reference parameter. A reference parameter does not create a new
instance, it points to the same storage location of the parameter passed as an argument. vi) Output parameters: - A parameter
declared with an out modifier is an output parameter. A reference parameter does not create a new instance, it points to the
same storage location of the parameter passed as an argument. But output parameter must be definitely assigned before the
function returns. vii) Local variables: - A local variable is declared and exits within a block, for-statement, switch- statement,
using statement. A local variable is not automatically initialized, thus has no default value.

3. What is the importance of automatic memory management? Explain with example?
Ans: In earlier days, developers need to manage the allocation and de-allocation of blocks of memory, which is known as Manual
memory management. Manual memory management can be both time-consuming and difficult.
→ But in .NET Framework, CLR provides a run-time environment, which manages the execution of code and provides essential
services like Automatic memory management. → Automatic memory management eliminates memory leaks as well as some
other common programming errors. → In C#, automatic memory management is provided so that developers are freed from this
burdensome task. → Automatic memory management increases code quality and enhances developer productivity without
negative impact on either expressiveness or performance.

4. Write a note on expression and operators in C#.
Ans: Expression: - An expression is a sequence of operators and operands that specifies computation and assigns the result to a
variable. Expressions are constructed from operands and operators. The operators of an expression indicate which operations to
perform. Examples for operators are +, -, *, /, etc. Examples for operands are literals, variables, and expressions.
Operators: - There are three types of operators Unary, Binary, Ternary. Application use operators to process the data entered by
a user. Operators like + and – are used to process variables and return a value. An operator is a set of one or more characters
that is used for computations or comparisons. Operator can transform one or more data values, called operands, into a new data
value. Some examples of Operators are Arithmetic, Arithmetic Assignment, Unary, Comparison, Logical operators.

5. What are empty statement and labeled statements? Why are they used?
Ans: Empty statement: - An empty statement (?) simply transfers control to the end point of the statement. It is used when there
are no operations to perform, but require a statement. An empty statement can be used when writing a while statement with a
null body and can also be used to declare a label just before the closing “}” of a block.
Labeled statement: - A labeled statement is prefixed by a label. Labeled statements are permitted in blocks. A label is a name
given by the identifier. The scope of a label is the block in which the label is declared. If two labels have same name we get
compile time error. A label can be referenced from goto statements within the scope of the label. Labels and other identifiers can
have same name.
Bsc (it)63
Multimedia Applications: Three broad classes of multimedia applications:
1. Streaming Stored Audio and Video: Stored audio files might contain audio data. Stored video files might contain video data.
    This class of applications has three key distinguishing features.
          Stored media: The multimedia content has been prerecorded and is stored at the server. As a result, a user may
            pause, rewind, fast-forward, or index through the multimedia content. The time from when a client click, the whole
            media file downloaded and then we start hearing that music at the time elapsed should be on the order of one to ten
            seconds for acceptable responsiveness.
          Streaming: A client start play-out of the audio/ video of few seconds after it begins receiving the file from the server.
            This means that the client will be playing out audio/video from one location in the file while it is receiving later parts
            of the file from the server. This technique, known as streaming, avoids having to download the entire file before
            beginning play-out. There are many streaming multimedia products, such as RealPlayer, QuickTime and Media
            Player.
          Continuous play-out: Once play-out of the multimedia content start, it should proceed according to the original
            timing of the recording. This places critical delay constraints on data delivery. Data must be received from there
            server in time for its play-out at the client. Although stored media applications have continuous play-out
            requirements, their end-to-end delay constraints are nevertheless less stringent than those for live, interactive
            applications such as Internet telephony and video conferencing.
2. Streaming Live Audio and Video: This class of applications is similar to customary broadcast radio and television
    transmission emitted from any corner or the world. Since streaming live audio/video is not stored, a client cannot fast-forward
    through the media. However, with local storage of received data, other interactive operations such as pausing and rewinding
    through live multimedia transmissions are possible in some applications. Live, broadcast-like applications often have many
    clients who are receiving the same audio/video program. Live audio/video distribution is more often accomplished through
    multiple separate unicast streams. As with streaming stored multimedia, continuous play-out is required, although the timing
    constraints are less stringent than for real-time interactive applications.
3. Real-Time Interactive Audio and Video: This class of applications allows people to use audio/video to communicate with
    each other in real time. Real-time interactive audio over the Internet is often referred to as Internet phone, from the user’s
    view; it is similar to the customary circuit-switched telephone service. There are hundreds of Internet telephone products
    currently PC-to- phone and PC-to-PC voice calls.
                                With real-time interactive video, also called video conferencing, individuals communicate visually
    as well as vocally. There are also many real-time interactive video products currently available for the Internet, including
    Microsoft’s NetMeeting. A real-time interactive audio/video application, a user can speak or move at any time.

Q. What is an audio? What is a video?
Ans: The process of flow of stream of the sound like speech and enjoyable music is known as Audio. Sound makes the multimedia
program and presentation more exciting and enjoyable. A video is a sequence of frames, with frames typically being displayed at
a constant rate, for example at 24 or 30 frames per second. An uncompressed, digitally encoded image consists of an array of
pixels, with each pixel encode into a number of bits to represent luminance and color

1. What is multimedia? Give examples of multimedia data.
Ans: Multimedia defines applications and technologies that manipulate text, data, images, and voice and full motion video
objects. Classic example of multimedia is the games available on CDs or songs and music available on sites.

2. How does an audio medium differ from a video medium?
Ans: Audio: It deals with only voice. For example, a song or a lecture on any university site.
Video: It has got both voice and live image, such as a movie, a song, or a clipping of a lecture.

3. What is streaming?
Ans: Streaming is the process of receiving stored audio/video application from a server where they are placed. A client begins to
play either an audio or a video once the media player of the client’s PC begins receiving the audio or video file from the server.
During the process, the client will be playing audio/video from one location in the file while it is receiving the remaining parts of
the file from the server. In other words, streaming avoids long download times and the need to store the entire file on the user's
computer.
4. What are the drawbacks of the present Internet to drive the multimedia data?
Ans: The Internet has some drawbacks with regard to multimedia data. For example, the media player does not communicate with
the streaming server directly. This delay, before play-out begins, is typically unacceptable for audio/video clips of moderate
length. For this reason, audio/video streaming implementations typically have the server send the audio/video file directly to the
media player process. In other words, a direct socket connection is made between the server process and the media player
process.
5. How can the present Internet be made to port multimedia data?
Ans: For making the existing Internet portable to multimedia data, the following modifications need to be done:
     A protocol is required that reserves bandwidth on behalf of the streaming server applications.
     The scheduling policies in the router queues should be modified so that the bandwidth reservations can be done. With the
        new scheduling policies, not all packets get equal treatment, instead the packets from the multimedia provider sites that
        reserve and pay more, get more bandwidth.
     The applications must give the network a description of the traffic that they intend to send to the network.
     The bandwidth and switching capacity should be enhanced to provide satisfactory delay and packet loss performance
        within the network.
     Caches must be installed in the networks. Caches bring stored content (web pages as well as stored audio and video)
        closer to users, thereby reducing the traffic in the higher-tier ISPs.
     Content providers that pay for a Content Distribution Networks (CDN) service should deliver content faster and more
        effectively.
     Multicast overlay networks can be deployed. A multicast overlay network consists of servers scattered throughout the ISP
        network and potentially throughout the entire Internet. Servers and the logical links between servers collectively form an
        overlay network, which multicasts traffic from a source to millions of users.

6. Why do audio and video file need to be compressed?
Ans: Compression is required to reduce the size of audio and video so that they can be easily transmitted over the Internet.
For example, a single image consisting of 1024 pixel * 1024 pixels, with each pixel encoded into 24 bits requires 3 MB of storage
without compression. There are eight bits, three each for the colors red, green, and blue. It would take approximately seven
minutes to send the image over a 64 kbps link. If the image is compressed at a modest 10:1 compression ratio, the storage
requirement is reduced to 300 Kbytes and the transmission time also drops by a factor of 10.

7. Explain the audio streaming process.
Ans: Audio streaming is the transfer of audio-encoded packets that are decoded and sent to the client’s soundcard upon
reception. The host side is responsible for encoding and packetizing the audio stream. The client side is responsible for decoding
the packets and sending the decoded audio to the sound card.
There are delays inherent in the overall system. These delays are contributed by the encode/decode delay, transfer delay, buffer
delay, modem delay, sound card delay, and other delays. As long as the delays are kept constant, then the audio will be delivered
uninterrupted.

8. What is a streaming server?
Ans: Streaming servers are meant for the audio/video streaming applications. Upon client request, a server directs an audio or a
video file to the client by sending the file into a socket. Both the TCP and UDP socket connections are used. Before sending the
audio/video file to a network, the file is segmented, and the segments are typically encapsulated with special headers appropriate
for audio and video traffic.
Streaming servers send digital video for news, entertainment, or educational content over the Internet by using RTP/RTSP. A
multimedia file gets uploaded on the server and streaming servers encodes content in the latest media formats including MPEG- 4
(Moving Picture Expert Group) and the AAC (Advanced Audio Coder) audio.

9. What are the limitations of the best effort service? Explain.
Ans: Limitations of the best effort service are:
     Packet loss: As IP datagram crosses through a network over UDP, it passes through buffers in the routers in order to
       access outbound links. It is possible that one or more of the buffers in the route from sender to receiver is full and cannot
       admit the datagram. In this case, the IP datagram is discarded, never to arrive at the receiving application. Loss could be
       eliminated by sending the packets over TCP rather than over UDP.
     Excessive end-to-end delay: End-to-end delay is the accumulation of transmission, processing, and queuing delays in
       routers, propagation delays in the links, and end-system processing delays.
     Packet jitter: A crucial component of end-to-end delay is the random queuing delays in the routers. Because of these
       varying delays within the network, the time from when a packet is generated at the source until it is received at the
       receiver can fluctuate from packet to packet. This phenomenon is called jitter.
10. Discuss the features of Real Time Protocol (RTP).
Ans: The features of Real Time Protocol (RTP) are:
     RTP provides end-to-end delivery services for data with real-time characteristics such as interactive audio and video.
        However, RTP itself does not provide any mechanism to ensure timely delivery. It needs support from the lower layers of
        OSI model that actually have control over resources in switches and routers. RTP depends on Resource Reservation
        Protocol (RSVP) to reserve resources and to provide the requested quality of service.
     RTP provides timestamps, sequence numbers as hooks for adding reliability, flow, and congestion control for packet
        delivery, but implementation is totally left to the application.
     RTP is a protocol framework that is deliberately not complete. It is open to new payload formats and new multimedia
        software. By adding new profile and payload format specifications, one can tailor RTP to new data formats and new
        applications.
     The flow and congestion control information of RTP is provided by Real-Time Control Protocol (RTCP) sender and
        receiver reports.
     RTP/RTCP provides functionality and control mechanisms necessary for carrying real-time content. But RTP/RTCP itself
        is not responsible for the higher-level tasks like assembly and synchronization. These have to be done at the application
        level.

11. Explain how does the helper application get data from a streaming server.
Ans: Getting data from streaming server to helper application like the media player requires at least two servers where data is
placed. One server is the HTTP server, and the second server is the streaming server.
For example, when a user visits any songs/news web site, the web browser communicates with the web server where the user
chooses the file that has music or news. The moment the user clicks any media file; media player requests for the media file to the
streaming server and user receives the media file on the media player.

12. Explain RTSP.
Ans: RTSP is a protocol that enables a media player to control the transmission of a media stream. RTSP messages use the port
number 544 from the media stream. The RTSP specification, RFC 2326, permits RTSP messages to be sent over TCP or UDP.
                                  RTSP server keeps a track of the state of the client for each ongoing RTSP session. For example,
the server keeps track of whether the client is in an initialization state, a play state, or a pause state. The session and sequence
numbers, which are part of each RTSP request and response, help the server to keep track of the session state. The session number
is fixed throughout the entire session; the client increments the sequence number each time it sends a new message; the server
echoes back the session number, and the current sequence number. RTSP does not do:
      RTSP does not define compression schemes for audio and video.
      RTSP does not define how audio and video are encapsulated in packets for transmission over a network; encapsulation
         for streaming media can be provided by RTP or by a proprietary protocol.
      RTSP does not restrict how streamed media is transported; it can be transported over UDP or TCP.
      RTSP does not restrict how the media player buffers the audio/video.

13. What is UDP?
Ans: The User Datagram Protocol (UDP) is one of the core protocols of the Internet protocol suite. By using UDP, programs on
networked computers can send short messages known as data-grams to one another. However, UDP does not provide the
reliability and ordering guarantees that TCP provides.

14. What is ATM AAL5?
Ans: Asynchronous Transfer Mode Adaptation Layer Type 5 (ATM AAL5) is a protocol that provides virtual connections between
end stations attached to the same network. ATM AAL5 supports variable bit rate and delay-tolerant connection-oriented data
traffic requiring minimal sequencing or error detection support.

15. Give an example of a streaming server available in the market today.
Ans: Media-Box AS-2608 is an embedded streaming server capable of encoding from eight different inputs of high quality audio
through broadband networks at various stream rates in multiple formats: MPEG4, Real, MP3, and Vorbis.
1. What are WLANs?
Ans: WLAN stands for wireless Local Area Network. WLAN local area network transmits and receives data over the air, usually
in unlicensed sector of the spectrum, using either radio or infrared technologies, providing users with both access and mobility.
WLAN is a network that uses high-frequency radio waves rather than wires to communicate between nodes. WLAN technologies
enable users to establish wireless connections within a local area such as within a corporate or campus building, or in a public
space like airport. IEEE approved the 802.11 standard for WLANs, which specifies a data transfer rate of 1-2 Mbps.

2. What is modulation?
Ans: Modulation is the process of integration of external signal (like data) with characteristic of generated periodic wave.
                             It is also utilized to send an information beaming signal over distance.
                                        Modulation is the addition of information or the signal to an electronic or optical signal
                             carrier. There are several reasons to modulate a signal before transmitting signal in a medium.
                             This includes the ability of various users sharing a medium and making the signal properties
                             physically compatible with the propagation medium.

3. What is a carrier signal?
Ans: A signal of chosen frequency generated to carry data, often used for long distance transmission and data is added to this
                                carrier signal modulation and decoded on the receiving and demodulation.
                                 A carrier signal is a specific frequency in an analog communication channel that is modulated
                                with an information-carrying signal. Carrier signals are commonly used in Amplitude
                                Modulation (AM), Frequency Modulation (FM), and other radio transmissions to differentiate
                                among channels. We turn a radio dial to select a carrier frequency. The radio then amplifies the
                                signal carried on the selected frequency. In AM, modulation changes the strength or amplitude of
                                the carrier signal. In FM, the frequency of the carrier signal is modulated.




4. Define SNR.
Ans: SNR stands for Signal-to-Noise Ratio. It is the ratio between the typical signal level and the softest signal that can be
                                   produced accurately.
                                   The relationship between the usable intended signal and extraneously present noise present,
                                   usually measured at the source and it express in Database. SNR is the ratio of total signal to
                                   noise expressed in decibels (dB); SNR=20 log(Signal RMS/Noise RMS).


5. What is BW?
Ans: BW stands for bandwidth, which is the range within a band of frequencies or wavelengths. BW can also be defined as the
amount of data that can be transmitted in a fixed amount of time. For digital devices, bandwidth is usually expressed in bits per
second or bytes per second (bps). For analog devices, bandwidth is expressed in cycles per second or Hertz (Hz).
Bandwidth; it is the amount of data that can be transferred over the network in a fixed amount of time. It is usually expressed in
bit per second (bps) or in higher units like (million of bit per second) mbps i.e. 28.8 modern can deliver 28,800 bps and T1 line is
about 1.5 mbps.
6. Compare 802.11a, 802.11b, 802.11g and Bluetooth.
Ans: 802.11a, 802.11b, 802.11g, and Bluetooth are compared in the following table.
                      Feature            802.11a              802.11b              802.11g           Bluetooth
                      Data rate          54-72Mbps            11Mbps               54Mbps            721Kbps
                                                                                                     56 Kbps
                      Frequency          5Ghz                 2.4Ghz               2.4Ghz            2.4Ghz
                      Modulation         OFDM                 DSSS/CCK             DSSS/PBCC         FHSS
                      Channels           12/8                 11/3                 11/3              79
                                                                                                     ( 1Mhz wide)
                      Bandwidth          300                  83.5                 83.5              83.5
                      Available                                                    (22MHz       per
                                                                                 channel)
                      Power                40-800mW            100mW             100mW             100mW
                                           Comparison of 802.11a, 802.11b, 82.11g, and Bluetooth
7. List out the advantages and disadvantages of WLAN.
Ans: The advantages of WLAN are:
     Flexibility: Within radio coverage, nodes can communicate without further restriction. Radio waves can penetrate walls,
         and senders and receivers can be placed anywhere.
     Easy to use: The wireless networks are easy to set-up and use. Just plug-in a base station and equip your laptops with
         WLAN cards.
     Robustness: Wireless networks can survive disasters. Networks requiring a wired infrastructure will break down
         completely some time. If one base station goes down, users may be able to physically move their PCs to be in range of
         another.
The disadvantages of WLAN are:
     Quality of Service (QoS): WLANs typically offer lower quality than wired networks. The main reasons for offering low
         quality are lower bandwidth due to limitations in radio transmission, higher error rates due to interference (10 -4 instead
         of 10-10 for fiber optics), and higher delay/delay variation.
     Vulnerable to interference: If a powerful transmitter operating in the same band as the wireless network is nearby, the
         wireless network could be rendered completely useless.
     Speed: Data speeds drop as the user moves further away from the access point.
     Operation within limited distance: Devices will only operate at a limited distance from an access point. Obstacles
         between the access point and the user such as walls, glass, water, trees and leaves can also determine the distance of
         operation.
     Safety and security: Using radio waves for data transmission might interfere with other high-tech equipment.
         Additionally, the open radio interface makes eavesdropping much easier in WLANs than in the case of fiber optics.

8. Compare radio and infrared transmission.
Ans: The differences between radio and infrared transmissions are as follows.
Radio Transmission: Radio transmission can cover larger areas and can penetrate walls, furniture, plants, and so on. Radio
transmission does not typically need a direct line of sight (LOS) to exist between the receiver and the sender if the frequencies are
not too high. Radio transmission offers very high data transfer rates than Infrared. Current radio-based products offer
transmission rates up to 10 Mbps. In this case, shielding is not so simple. Therefore, radio transmission can interfere with other
senders and electrical devices can destroy data transmission via radio. In this case, shielding is not so simple. Therefore, radio
transmission can interfere with other senders and electrical devices can destroy data transmission via radio. Radio transmission
is used for wide area networks (WAN) such as microwave links and mobile cellular phones. WLAN technologies such as IEEE
802.11, HIPERLAN, and Bluetooth make use of this type of transmission.
IR Transmission: IR transmission cannot penetrate walls or other obstacles. For good transmission quality and high data rates,
typically a LOS is needed between the sender and the receiver. IR transmission offers lower transmission rates. The products
using the latest version of IR Data Association interface support data transfer rates up to 4 Mbps. In this case, shielding is very
simple. Therefore, electrical devices do not interfere with infrared transmission. No licenses are required for infrared technology.
IR technology is normally used for devices like PDAs, laptops, notebooks, mobile phones, and so on. Only IEEE 802.11 makes use
of this type of transmission.

9. Discuss the architecture of WLAN.
Ans: WLAN architecture consists of three components: Wireless end stations, Access points, Basic service sets (BSS)
                                                       The wireless end station can be any device that can communicate using
                                                       the 802.11 standard. These devices include laptops, workstations, and
                                                       PDAs, as well as printers and scanners.
                                                                                         The access point (AP) is a device. It
                                                       acts as a network platform for connections between WLANs or to a
                                                       wired LAN and as a relay between stations attached to the same AP.
                                                       BSS is the logical component of wireless architecture. In general, it is a
                                                       set of wireless stations controlled by a single management function and
                                                       has two configuration options that is, Infrastructure BSS (IBSS) and
                                                       Extended Service Set (ESS).
                                                                                         In an IBSS, the stations communicate
                                                       directly to one another without the need for an access point. An ESS is
                                                       a set of infrastructure BSSs that appear as a single BSS. This is
                                                       important for connection redundancy but has some security issues that
need to be addressed.

10. Briefly explain the WLAN protocol architecture and bridging.
Ans: In a typical WLAN setup, the IEEE 802.11 standard WLAN (Access Point) gets connected to an IEEE 802.3 standard
                                                              Ethernet (Switch/HUB) via a bridge. The higher layers
                                                              (application, TCP, IP) look the same for the wireless node as for
                                                              the wired node. The IEEE 802.11 standard only covers the
                                                              physical layer (PHY) and medium access layer (MAC) like the
                                                              other 802.x LANs do. The physical layer is sub divided into the
                                                              Physical Layer Convergence Protocol (PLCP) and the Physical
                                                              Medium Dependent Sub Layer.
                                                              The basic tasks of the MAC layer comprise medium access,
                                                              fragmentation of user data, and encryption. The PLCP sublayer
                                                              provides a carrier sense signal called Clear Channel
                                                              Assessment (CCA), and provides a common PHY interface for
                                                              the MAC, which is independent of the transmission technology.

Q. Explain IEEE 802.11 standard.
Ans: The wireless 802.11 standard is a top-level standard that has been divided into several subsections, including 802.11a,
802.11b, and 802.11g. The 802.11 umbrella covers the sub-committee standards 802.11a, b, and g, along with any other 802.11
standards.
There has been more than just the IEEE committee work on wireless standards. Thinking that it could improve both marketing and
product quality, a consortium called Bluetooth was formed. Bluetooth’s promoters include 3Com, Ericsson, IBM, Intel, Microsoft,
Motorola, Nokia, and Toshiba, as well as hundreds of associate and adapter member companies.

MAC Management:
MAC management plays a central role in an IEEE 802.11 station as it more or less control all functions related to system
integration i.e., integration of a wireless station into a BSS, formation of an ESS, synchronization of stations etc. The functional
groups include:
    a) Synchronization of time: Each node of an 802.11 network maintains an internal clock. To synchronize the clocks of all
        nodes, IEEE 802.11 specifies a timing synchronization function (TSF). Synchronized clocks are needed for power
        management, but also for coordination of the PCF, for synchronization of the hopping sequence in an FHSS system.
        Within a BSS, timing is conveyed by the periodic transmission of a beacon frame. A beacon contains a timestamp and
        other management information used for power management and roaming. The timestamp is used by a node to adjust its
        local clock. Within the infrastructure-based networks, the AP performs synchronization by transmitting the periodic
        beacon signal, whereas all other wireless nodes adjust their local timer to the time stamp. If collision occurs, the beacon
        is lost. The beacon intervals can be shifted slightly in time because all clocks may vary and, thus also the start of a beacon
        interval from a node’s point of view. After synchronization all nodes again have the same consistent view.
    b) Power management: Standard LAN protocols assume that stations are always ready to receive data, although receivers
        are idle most of the time in lightly loaded networks. However, this permanent readiness of the receiving module is critical
        for battery lifetime as the receiver current may be up to 100mA. Longer periods of sleep save battery life but reduce
        average throughput and vice versa. The basic idea of power saving includes two actions for a station, sleep and awake,
        and buffering of data in senders it has to buffer data if the station is asleep. Waking up at the right moment requires the
        timing synchronization function (TSF). All stations have to wake up or be awake at the same time. Power management in
        infrastructure-based networks is much simpler compared to ad hoc networks. Destinations are announced using ad hoc
        traffic indication map (ATIMs) –the announcement period is called the ATM window. Due to this synchronization, all
        stations within the ad hoc network wake up at the same time. All stations stay awake for the ATIM interval as shown in the
        first steps and go to sleep again if no frame is buffered for them
    c) Roaming: Typical wireless networks within buildings require more than just one access point to cover all rooms.
        Depending on the solidity and material of the walls on one AP has a transmission range of 10-20 m if transmission is to
        have a decent quality. Moving between APs is called roaming. The steps for roaming between AP are the following:
              A station that the current link quality to its AP1 is too poor. The station then starts scanning for another AP.
              Scanning involves the active search for another BSS and can also be used for setting up a new BSS in case of ad
                  hoc networks. Passive scanning means listening into the medium to find other networks, i.e., function within an
                  AP. Active scanning comprises sending a probe on each channel and waiting for response.
              The station then selects the best AP for roaming based on, e.g., signal strength, and sends an association request
                  to the selected AP2.
              The new AP answers with an association response.
               The AP accepting an association’s request indicates the new station in its BSS to the distribution system (DS). The
                DS then update its database, which contains the current location of the wireless stations.
11. Write a note on DSSS.
Ans: Direct Sequence Spread Spectrum (DSSS) is the alternative spread spectrum method, in which the signal is spread over a
wide range of frequencies using a chipping code. In the case of IEEE 802.11 DSSS, spreading is achieved by using the 11-chip
sequence (+1,-1,+1,+1,-1,+1,+1,+1,-1,-1,-1), which is also called the Barker code.

12. Discuss the MAC layer of WLAN.
Ans: MAC layer controls medium access, and also offers support for roaming, authentication, and power conservation. The
services offered by MAC are mandatory asynchronous data service and an optional time-bounded service.

13. What is an electromagnetic spectrum?
Ans: The full range of frequencies from radio waves to gamma rays that characterizes light is called electromagnetic spectrum.

14. What are radio waves?
Ans: Radio waves are electromagnetic radiations that have the lowest frequency, the longest wavelength, and are produced by
charged particles moving back and forth. The atmosphere of the earth is transparent to radio waves with wavelengths from a few
millimeters to about 20 meters.

15. What is wavelength?
Ans: Wavelength is the distance between the repeated units of a wave pattern.

Lesion 5
1. What is cryptography?
Ans: Cryptography is the science of using mathematics to encrypt and decrypt data. Cryptography enables us to store or transmit
sensitive information across insecure networks (like the Internet) so that unauthorized users except the intended recipient cannot
read it. CRYPTOGRAPHY:
Cryptographic systems are generically classified along three dependent dimensions:
1) The type of operations used for transforming plaintext to cipher text: All encryption algorithms are based on two general
    principles: Substitution, in which each element in the plaintext (bit, letter, group of bits or letters) is mapped into another
    element, and transposition, in which elements in the plaintext are rearranged.
2) The number of keys used: If both sender and receiver use the same key, the system is referred as symmetric or singe-key or
    secret-key or conventional encryption. If the sender and receiver each uses a different key, the system is referred to as
    asymmetric, two key or public key encryption.
3) The way in which the plaintext is processed: This cipher processes the input of one block of elements at a time, producing an
    output block for each input block.

2. Explain cryptographic algorithms.
Ans: A cryptographic algorithm, also referred to as cipher, is a mathematical function used in the encryption and decryption
process. A cryptographic algorithm works in combination with a key. The key may be a word, number, or phrase used to encrypt
the plain text, also called a message. The plain text encrypts to cipher text with different keys. The security of encrypted data is
entirely dependent on the strength of the cryptographic algorithm and the secrecy of the key. Different cryptographic algorithms
are Caesar Cipher, Monoalphabetic Ciphers, Playfair Cipher, Hill Cipher, and Transposition Ciphers.

5. Explain the conventional encryption model?
Ans: Before the development of public key encryption, the conventional encryption (single-key encryption) was available to secure
the networks.                                     There are two types of encryption, classical encryption and mo dern encryption
techniques. These are key based algorithms known as symmetric and public key algorithms.
                      In conventional algorithms, the encryption key can be calculated from the decryption key. Alternatively, the
decryption key can be calculated from the encryption key. In these algorithms, the encryption key and the decryption key are
same. These algorithms are also called secret key algorithms, or the one key algorithm. In this encryption technique, the sender
and receiver agree to use a key before they communicate securely. The security of the symmetric algorithm rests in the key. The
key allows users to encrypt and decrypt messages by using any encryption and decryption algorithms.

4. Briefly explain security mechanisms.
Ans: Mechanisms that ensure security of an organization are known as security mechanisms. Encryption or encryption like
transformations of information is the most common means of providing security.
There are certain common information integrity functions to secure network/data like identification, validation, authorization,
time of occurrence, signature, authenticity, concurrence, ownership, receipts, registration, endorsement, privacy, access, and
endorsement.
3. Explain different types of attacks.
Ans: Attacks are of two types. The types are:
    1) Passive attack: In this attack, the goal of the unauthorized user is to obtain information that is being transmitted. Passive
         attacks have two subtypes, release of message contents and traffic analysis.
     The release of message contents includes conversation over the phone or through email or transferring a file from one
         place to another, which might contain sensitive information.
     The traffic analysis is more delicate. Suppose that we had a way of masking the contents of messages or other information
         traffic so that unauthorized users could not extract the information from the message. The common technique for masking
         contents is encryption. If we had encryption protection in place, an opponent might still be able to observe the pattern of
         these messages. The opponent could determine the location and identity of communication hosts, and could observe the
         frequency and length of messages being exchanged. This information might be useful in guessing the nature of the
         communication that was taking place.
Passive attacks are very difficult to detect because they do not involve any alteration of the data. The emphasis in dealing with
passive attacks is to prevent the attack rather than to detect it.
    2) Active attacks: These attacks involve some modification of the data stream or the creation of a false stream. These attacks
         are divided into four categories such as masquerade, replay, modification of messages, and denial of service (DoS).
     Masquerade: It takes place when an entity pretends to be different than the other entity. This includes one of the other
         forms of an active attack, which is modification of messages or denial of service.
     Replay: It involves the passive capture of a data unit and its subsequent retransmission to produce an unauthorized effect.
     Modification of messages: It implies that some portion of the message is altered or messages are delayed or reordered to
         produce an unauthorized effect.
     DoS: It prevents or inhibits the normal use or the management of communications facilities. This type of attack has a
         specific target. For example, an entity may suppress all messages directed to a particular destination. Another form of
         DoS is the disruption of an entire network, either by disabling the network or by overloading it with messages to degrade
         the performance of the network.
Active attacks posses opposite characteristics than that of passive attacks. Active attacks are difficult to prevent because physical
protection of all communications facilities and paths at all times is required. Instead, the goal is to detect active attacks and to
restore the network from any disruption or delays caused by them.

6. What is Steganography?
Ans: Steganography is a technique that is used to hide the secret message in other messages.
A few examples of steganography are:
     Character marking: Selected letters of printed or type written text are overwritten in pencil. The marks are ordinarily not
        visible unless the paper on which text is printed or type written is held at an angle to bright light.
     Invisible ink: A number of substances can be used for writing but the ink leaves no visible trace until heat or a specific
        chemical is applied to the paper.
     Pin punctures: Small pin punctures on selected letters are ordinarily not visible unless the paper is held up in front of a
        light.
     Typewriter correction ribbon: This is a black ribbon used between typed lines typed. The results of typing with the
        correction tape are visible only in good light.

1. What are the advantages of cryptography?
Ans: Cryptography is all about increasing the level of privacy of individuals and groups. It not only protects the confidentiality of
any company’s information but also allows anyone to order a product over the Internet without the fear of the credit card number
being intercepted by any malicious attempt. For example, cryptography is often used to prevent forgers from counterfeiting
winning lottery tickets. Each lottery ticket can have two numbers printed onto it, one plaintext and the other its corresponding
cipher.

2. What is the disadvantage of a transposition cipher?
Ans: The disadvantage of a transposition cipher is that such ciphers are considerably more laborious and error prone than
simpler ciphers.

3. What is cryptology?
Ans: The study of both cryptography (enciphering and deciphering) and cryptanalysis (breaking a code system) together is called
cryptology.
Working of Cryptograph: A cryptographic algorithm (also referred as cipher), is a mathematical function used in the encryption
and decryption process. A cryptographic algorithm works in combination with a key. This key may be a word, number, or phrase
used to encrypt the plaintext. The same plaintext encrypts to different cipher text with different keys. The security of encrypted
data is entirely dependent on two things: the strength of the cryptographic algorithm and the secrecy of the key.

Security attack: An action that cooperation the security of information owned by an organization. Attacks on the security of a
computer system or network are to view the information. There are four general types of cryptanalytic attacks.
    Interruption: An asset of the system is destroyed or becomes unavailable or unusable. This is an attack on availability.
    Interception: an unauthorized party gains access to an asset. This is an attack on confidentiality. The unauthorized party
        could be a person, a program, or a computer.
    Modification: An unauthorized party not only gains access to but tampers with an asset. This attack is on integrity.
    Fabrication: An unauthorized party inserts counterfeit objects into the system. This is an attack on authenticity.

Model of Internet Security:
A model for network security transferred form one party to another across some sort of Internet. A logical information channel is
established by defining a route through the Internet from source to destination and by the cooperative use of communication
protocols by the two principals. Security aspects come into play when it is necessary or desirable to protect the information
transmission from an opponent who may present a threat to confidentiality, authenticity and so on. All the techniques for
providing security have two components:
                                                                         A security-related transformation on the information
                                                                             to be sent.
                                                                         Some secret information shared by the two
                                                                             principals and it is hoped, unknown to the opponent.
                                                                    A trusted third part may be needed to achieve secure
                                                                    transmission. A third party may be needed to arbitrate
                                                                    disputes between the two principals concerning the
                                                                    authenticity of a message transmission.
                                                                    There are four basic tasks in designing a particular security
                                                                    service:
                                                                        a) Design an algorithm for performing the security-
                                                                             related transformation. The algorithm should be
                                                                             such that an opponent cannot defeat its purpose.
                                                                        b) Generate the secrete information to be used with the
                                                                             algorithm.
                                                                        c) Develop methods for the distribution and sharing of
                                                                             the secret information.
    d) Specify a protocol to be used by the two principals that makes use of the security algorithm and the secret information to
        achieve a particular security service.
                                                    Hackers are the persons who attempt to penetrate systems that can accessed
over a network. The hacker can be someone who, with no malign intent, simply gets satisfaction from breaking and entering a
computer system.

Programs can present usually two kinds of threat:
                                                                   a) Information access threats: intercept or modify data on
                                                                       behalf of users who should not have access to that data.
                                                                   b) Service threats: exploit service flaws in computers to
                                                                       inhibit use by legitimate users.
                                                               The security mechanisms needed to cope with unwanted access fall
                                                               into two broad categories. The first category might be termed a
                                                               gatekeeper function. It includes password-based login procedures
                                                               that are designed to deny access to all but authorized users and
                                                               screening logic that is designed to detect and reject viruses and
                                                               other similar attacks. The second line of defense consists of a
        variety of internal controls that monitor activity and analyze stored information in an attempt to detect the presence of
        unwanted burglar.
Conventional Algorithms: Conventional or Symmetric algorithms can be divided into two categories.
     The first category of algorithms is called as stream algorithms or stream ciphers which operate on the single bit of the
        plaintext or byte at a time. Others operate on the plaintext in-groups of bits.
     The second category of the algorithm is block algorithms or block cipher, which operates on group of bits at a time.
    a) Model of message encryption and decryption:
A message is nothing but plaintext (also called clear text). The process of disguising a message in such a way as to hide its
substance is called encryption. An encrypted message is cipher text. The process of turning cipher text back into plaintext is called
decryption as shown below.
                                                                             M that stands for message or plaintext denotes either
                                                                             plain text. It can be a steam of bits, a text file, a
                                                                             bitmap, a stream of digitized voice, a digital video
                                                                             image. As far as a computer is concerned, M is simply
                                                                             binary data. The plaintext can be intended for either
transmission or storage, which is to be decrypted. C denotes Ciphertext which is also a binary data. The size of the C can
sometimes be the same size as M, or it may be larger than M. The encryption function E operates on M to produce C or in
mathematical function E(M)=C. In the reverse process, the decryption function D operates on C to produce M i.e., D(C) = M. The
whole point of encrypting and decryption a message is to recover the original plaintext. Both encryption and decryption
operations use the keys, so the functions become
Ek (M) =C             Dk (C) =M                    Dk (Ek (M)) =M
    b) Model of Conventional Encryption:
The essential elements of conventional encryption scheme are as shown in figure.
                                                                         A source         produces    a   message     in   plaintext,
                                                                            x=[x1,x2…xm]. The elements of X are letters in some
                                                                          finite alphabet. The alphabet usually consists of the 26
                                                                          letters. Nowadays, the binary alphabet {0,1} is
                                                                          typically used. For encryption, a key of the form k=[k1,
                                                                          k 2… k j] is generated. If the key is generated at the
                                                                          message source, then it must also be provided to the
                                                                          destination by means of some secure channel. With the
                                                                          message X and the encryption key K as input, the
                                                                          encryption algorithm form the cipher text Y=[ y1, y 2…
                                                                          y N]. We can write this as Y=Ek(X). This notation
                                                                          indicates that using encryption algorithm E as a
function of the Plaintext X, with the specific function determined produces Y by the value of the key. The intended receiver, in
possession of the key, is able to invert the transformation: X=Dk (Y). An opponent, observing Y but not having access to K or X,
may attempt to recover X or K or both X and K. If the opponent knows the encryption (E) and decryption (D) algorithms, he tries
to recover X by generating a plaintext estimate X1. By identifying the key or the decrypting the message he can read future
messages as well, in which case an attempt is made to recover K by generating an estimate K1.

Cryptanalysis: The whole point of cryptography is to keep the plaintext secrete from the opponents. The process of attempting to
discover X (Message or key) or both is known as cryptanalysis. There are four general types of cryptanalytic attacks.
1) Cipher text-only attack: The cryptanalyst has the cipher text of several messages, all of which have been encrypted using the
    same encryption algorithm. The cryptanalyst’s job is to recover the plaintext or key of any messages used to encrypt the
    messages, in order to decrypt other messages encrypted with the same key.
    Given: C1=Dm(P1),C2=Ek(P2)………….Ci=Ek(Pi)
2) Known–plaintext attack: The cryptanalyst has the access to the cipher text as well as plaintext of the messages.
   Cryptanalysts job is to deduce the key (or keys) used to encrypt the messages or an algorithm to decrypt any new messages
   encrypted with the same key (or keys).
    Given: P1C1=Ek(P1),P2,C2=Ek(P2)………….Pi,Ci=Ek(Pi)
3) Chosen plaintext attack: The cryptanalyst not only has access to the cipher text and associated plaintext for several
   messages, but also chooses the plaintext that gets encrypted. This is more powerful than a plaintext attack, because the
   cryptanalyst can choose specific plaintext blocks to encrypt, which might yield more information about the key.
     Given: P1C1=Ek(P1),P2,C2=Ek(P2)………….Pi,Ci=Ek(Pi)                     Where the cryptanalyst gets to choose P1,P2…Pi
4) Adaptive chosen plaintext attack: This is a special case of chosen plaintext attack. In this attack the cryptanalyst can choose
   and modify the plaintext that is encrypted, based on the results of previous encryption.
                                          The cipher text-only attack is the easiest attack to defend against other attacks. The
analyst is able to capture one or more plaintext messages as well as their encryptions.
Classical Encryption Techniques:
In the classical encryption techniques there are four types of substitution ciphers:
     1. A simple substitution cipher or mono-alphabetic cipher- This is the one in which each character of the plaintext is
         replaced with a corresponding character of cipher text. The cryptograms in newspapers are simple substitution ciphers.
     2. A homophonic substitution cipher – is like a simple substitution cryptosystem, except a single character of plaintext can
         map to one of several characters of cipher text.
     3. A Polygram substitution cipher is one in which blocks of characters are encrypted in-groups.
     4. A poly-alphabetic substitution cipher is made up of multiple simple substation ciphers. For example, there might be five
         different simple substation ciphers used; the particular one used changes with the position of each character of plaintext.

Substitution Techniques or Substitution Ciphers: A substitution cipher is one in which each character in the plaintext is
substituted for another character in the cipher text. The receiver decrypts the cipher-text or the encrypted message to deduce or to
recover the plaintext.
    a) Caesar Cipher:
    This is the most famous substitution algorithm, in which each plaintext character is replaced by the character three to the
    right modulo 26. (I.e. A is replaced “D”, B is replaced by “E”) For example:
    Plain text: m e e t m e t o m o r r o w                  Cipher: PHHW PH WRPRUURZ
    Note that the alphabet is warped around, so that the letter following Z is A. The transformation can be listed by the following
    possibilities:
     Plain: a b c d e f g h i j k l m n o p q r s t u v w x y z         Cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A
    BC
    If the numerical values are assigned value of each letter is equal to (a=1,b=2, etc,) then the algorithm is expressed as follows.
    For each plaintext letter p, substitute the cipher text letter C:           C= E(p) = ( p + 3 ) mod (26)
    A shift may be of any amount, so that the general Caesar algorithm is C = E (p) = (p + k) mod(26) k in the range 1 to 25.
    The decryption algorithm is given by P = D (C) = (C – k) mod(26)
                                 The brute force cryptanalysis is used because of the following three characteristics:
          The encryption and decryption algorithms are known.
          There are only 25 keys to try.
          The language of the plaintext is known and easily recognizable.

    b) Monoalphabetic Ciphers:
    With only 25 possible keys, the Caesar cipher is far from secure. A sequential increase in the key space can be achieved by
    allowing an arbitrary substation. The cipher line can be any permutation of the 26 possible keys. This is 10 orders of
                                            26 alphabetic characters, then there are 26! Or greater than 4x 10 magnitudes
                                            greater than the key space for DES and would seem to eliminate brute force
                                            techniques for cryptanalysis. The relative frequency diagram of the character of
                                            English is as shown in figure.
                                            The two principal methods are used in substitution ciphers to lessen the extent to
                                            which the structure of the plaintext survives in the cipher-text. One approach is to
                                            encrypt multiple letters of plaintext, and the other is to use multiple cipher alphabets.

    c) Playfair Cipher:
    Multiple letter encryption cipher is the play-fair, which treats diagrams in the plaintext as single units and translates these
    units into cipher-text diagrams. The play-fair algorithm is based on the use of a 5x5 matrix of letters constructed using a
    keyword. For example
                                                          In this case, the keyword is monarchy. The matrix is constructed by filling
                                                          the letters of the keyword from left to right and from top to bottom, and then
                                                          filling in the remainder of the matrix with the remaining letters in
                                                          alphabetic order. The letters J and I count as one letter. Plaintext is
                                                          encrypted two letters at a time, according to the following rules:
                                                                   i) Repeating plaintext letters that would fall in the same pair are
             separated with a filler letter, such as x, so that balloon would be enciphered as ba lx lo on.
        ii) Plaintext letters that fall in the same row of the matrix are each replaced by the letter to the right, with first element of
             the row circularly following the last. For example, ar is encrypted as RM.
        iii) Plaintext letters that fall in the same column are each replaced by the letter beneath, with the top element of the row
             circularly following the last. For example, mu is encrypted as CM.
        iv) Otherwise, the letter that lies in its own row replaces each plaintext letter and the column occupied by the other
             plaintext letter. Thus, hs become BP and ea becomes IM.
    d) Hill Cipher:
This is the multi letter cipher algorithm developed by the mathematician Lester Hill in 1929. The encryption algorithm takes
m successive plaintext letters and substitutes for them m cipher text letters. The substitution is determined by m linear
equations in which each character is assigned a numerical value (a=0,b=1,….z=25). For m=3 the system can be described as
follows:

                                        Express                                        in   term   of   column   and    matrices.




                                                                                    use
                                                    for encryption key.
                     The inverse of metric




The   demonstrated     as                                           follows




In general terms, the Hill system can be expressed as follows”




e) Transposition Ciphers:
In a transposition cipher the plaintext remains the same, but the order of characters is shuffled around. In a simple columnar
transposition cipher, the plaintext is written horizontally onto a piece of graph paper of fixed width and the cipher-text is read
off vertically seen the following example. Decryption is a matter of writing the cipher-text vertically onto a piece of graph
paper of identical width and then reading the plain text off horizontally.
Plaintext: COMPUTER GRAPHICS MAY BE SLOW BUT AT LEAST IT’S EXPENSIVE
                      Cipher-text: CAELPOPSEEMHLANPIOSSUCWTITSBIVEMUTERATSGYAERBTX
                      A pure transposition cipher is easily recognized because it has the same letter frequencies as the
                      original plaintext. For the type of columnar transposition just shown, cryptanalysis is fairly
                      straightforward

				
DOCUMENT INFO
Shared By:
Stats:
views:85
posted:8/1/2011
language:English
pages:13
Description: this file is very user full. every file is write and very easy step ,and fully ansnwer