OSI Modal
OSI Modal
OSI Modal
NETWORKING
A computer network, often simply referred to as a network, is a group of computers and
devices interconnected by communications channels that facilitate communications among users
and allows users to share resources.
Local area network (LAN) : A small network constrained to a small geographic area. An
example of a LAN would be a computer network within a building.
Metropolitan area network (MAN) : Used for medium size area. For example city or a state.
Wide area network (WAN) : A larger network that covers a large geographic area. For example
any network whose communications links cross metropolitan, regional, or national boundaries.
OSI model
Packet
A packet is the unit of data that is routed between an origin and a destination on the Internet
When any file is sent from one place to another on the Internet, the Transmission Control
Protocol (TCP) layer of TCP/IP divides the file into "chunks" of an efficient size for routing.
Each of these packets is separately numbered and includes the Internet address of the destination.
The individual packets for a given file may travel different routes through the Internet. When
they have all arrived, they are reassembled into the original file.
Protocol
A communications protocol is the rules or set of instructions for transferring data in or between
computing systems and in telecommunications. Protocols may include signaling, error detection
and correction capabilities. A protocol describes the syntax, semantics, and synchronization of
communication.
Example: TCP/IP
The major functions and services performed by the Physical Layer are:
• Establishment and termination of a connection to a communications medium.
• Participation in the process whereby the communication resources are effectively shared
among multiple users.
• Modulation.
• It provides the hardware means of sending and receiving data on a carrier
• Once it decodes the bit stream, the physical layer notifies the data link layer that a frame
has been received and passes it up.
MAC=Media Access control(controls how a computer on the network gains access to the data
and permission to transmit it.)
LLC=Logical Link control(controls flow control, frame synchronization, error checking)
Data link layer is responsible for moving frames from one hop (node) to the next .
Framing. The data link layer divides the stream of bits received from the network layer
into manageable data units called frames.
Flow control. If the rate at which the data are absorbed by the receiver is less than the
rate at which the data are produced in the sender, the data link layer imposes a flow
control mechanism to avoid overwhelming the receiver.
Error control. The data link layer adds reliability to the physical layer by adding
mechanisms to detect and retransmit damaged or lost frames. It also uses a mechanism to
recognize duplicate frames. Error control is normally achieved through a trailer added to
the end of the frame.
Access control. When two or more devices are connected to the same link, data link
layer protocols are necessary to determine which device has control over the link at any
given time.
Network Layer
The network layer is responsible for the source-to-destination delivery of a packet, possibly
across multiple networks (links). Whereas data link layer overseas the delivery of the packet
between two systems on the same network (links), the network layer ensures that each packet
gets from its point of origin to its final destination.
If two systems are connected to the same link, there is usually no need for a network layer.
However, if two systems are attached to different networks (links) with connecting devices
between the networks (links), there is often a need for the network layer to accomplish source-to-
destination delivery.
Network layer is responsible for the delivery of individual packets from the source host to the
destination host.
Logical addressing. The physical addressing implemented by the data link layer handles
the addressing problem locally . If a packet passes the network boundary, we need
another addressing system to help distinguish the source and destination systems. The
network layer adds a header to the packet coming from the upper layer that, among other
things, includes the logical address of the sender and receiver .
Error handing
Transport Layer
The Transport layer is responsible for process-to-process delivery of the entire message. A
process is an application program running on a host. Whereas the network layer overseas source-
to-destination delivery of individual packets, it does not recognize any relationship between
those packets. It treats each one independently, as though each piece belonged to a separate
message, whether or not it does. The Transport layer, on the other hand, ensures that the whole
message arrives intact and in order, overseeing both error control and flow control at the source-
to-destination level.
Transport layer is responsible for the delivery of a message from one process to another.
Service-point addressing. Computers often run several programs at the same time. For
this reason, source-to-destination delivery means delivery not only from one computer to
the next but also from a specific process (running program) on one computer to a specific
process (running program) on the other. The transport layer header must therefore include
a type of address called a service-point address (or port address) . The network layer gets
each packet to the correct computer.
Flow control. Like the data link layer, the transport layer is responsible for flow control.
However, flow control at this layer is performed end to end rather than across a single
link.
Error control. Like the data link layer, the transport layer is responsible for error
control. However, error control at this layer is performed process-to-process rather than
across a single link. The sending transport layer makes sure that the entire message
arrives at the receiving transport layer without error (damage,loss , or duplication) . Error
correction is usually achieved through retransmission.
SESSION LAYER
The session layer is the network dialog controller.
a) dialog control: the session layer allow two system to enter into a dialog. It
allows the communication between two process to take place either in half-
duplex(one way at a time) or full-duplex(two way at a time). For examples,
the dialog between a terminal connected to a mainframe can be half-duplex.
The Session Layer of the OSI model is responsible for session check pointing and recovery. It
allows information of different streams, perhaps originating from different sources, to be
properly combined or synchronized.
An example application is web conferencing, in which the streams of audio and video must be
synchronous to avoid so-called lip synch problems. Floor control ensures that the person
displayed on screen is the current speaker.Another application is in live TV programs, where
streams of audio and video need to be seamlessly merged and transitioned from one to the other
to avoid silent airtime or excessive overlap.
PRESENTATION LAYER
The presentation layer is concerned with the syntax and semantics of the
information exchanged between two system.
Remember
• A convenient aid for remembering the OSI layer names is to use the first
letter of each word in the phrase:
• All People Seem To Need Data Processing
4)Transport Layer To
WHAT IS SQL?
SOLUTION:-
ASSIGNMENT 3:-
CREATE A TABLE OF EMPLOYEES WITH FOLLOWING FIELDS:-
I. NAME , ID, SALARY, GENDER, AGE, ADDRESS & DEPARTMENT.
II. ENTER 10 RECORDS
III. FETCH ALL THE DATA
IV. FETCH THE NAME AND SALARY.
SOLUTIONS:-
INTRODUCTION OF DBMS
Assignment 4
What is DBMS?
• DBMS stands for Data Base Management System.
• DBMS is system software used to manage the organization, storage, access,
security and integrity of data in a structured database.
• It accepts requests from the application and instructs the operating system to
transfer the appropriate data.
• There are different types of DBMS products: Relational, Network and
Hierarchical. The most widely commonly used type of DBMS today is the
Relational Database Management Systems (RDBMS).
Major Features of DBMS
• Data Security
The DBMS can prevent unauthorized users from viewing or updating the
database. Using passwords, users are allowed access to the entire database.
• Data Integrity
The DBMS can ensure that no duplicate records out of the database; for example,
no two customers with the same customer number can be entered.
• Interactive Query
A DBMS provides a query language and report writer that lets users interactively
interrogate the database. These essential components give users access to all
management information as needed.
• Interactive Data Entry and Updating
A DBMS typically provides a way to interactively enter and edit data, allowing
you to manage your own files and databases.
• Data Independence
When a DBMS is used, the details of the data structure are not stated in each
application program. Any change in data structure requires changing all
application programs.
Data Definition Language (DDL):-
• Used to specify a database scheme as a set of definitions expressed in a DDL
• DDL statements are compiled, resulting in a set of tables stored in a special file called a
data dictionary or data directory.
• The data directory contains metadata (data about data)
• The storage structure and access methods used by the database system are specified by a
set of definitions in a special type of DDL called a data storage and definition language
• Basic idea: hide implementation details of the database schemes from the users
Procedural: the user specifies what data is needed and how to get it
Non-procedural: the user only specifies what data is needed
Easier for user
May not generate code as efficient as that produced by procedural languages
4. A query language is a portion of a DML involving information retrieval only. The terms
DML and query language are often used synonymously.
1. Data Definition Language (DDL) statements are used to define the database
structure. Some examples:
2. Data Manipulation Language (DML) statements are used for managing data within
schema objects. Some examples:
• DELETE - Deletes all records from a table, the space for the records remain
DBMS Keys
A key is an attribute (also known as column or field) or a combination of attribute that is
used to identify records. Sometimes we might have to retrieve data from more than one
table, in those cases we require to join tables with the help of keys. The purpose of the
key is to bind data together across tables without repeating all of the data in every table.
The various types of key with e.g. in SQL are mentioned below, (For examples let
suppose we have an Employee Table with attributes ‘ID’ , ‘Name’ ,’Address’ ,
‘Department_ID’ ,’Salary’)
(I) Super Key – An attribute or a combination of attribute that is used to identify the
records uniquely is known as Super Key. A table can have many Super Keys.
E.g. of Super Key
1 ID
2 ID, Name
3 ID, Address
4 ID, Department_ID
5 ID, Salary
6 Name, Address
7 Name, Address, Department_ID ………… So on as any combination which can
identify the records uniquely will be a Super Key.
(II) Candidate Key – It can be defined as minimal Super Key or irreducible Super Key.
In other words an attribute or a combination of attribute that identifies the record
uniquely but none of its proper subsets can identify the records uniquely.
E.g. of Candidate Key
1 Code
2 Name, Address
For above table we have only two Candidate Keys (i.e. Irreducible Super Key) used to
identify the records from the table uniquely. Code Key can identify the record uniquely
and similarly combination of Name and Address can identify the record uniquely, but
neither Name nor Address can be used to identify the records uniquely as it might be
possible that we have two employees with similar name or two employees from the same
house.
(III) Primary Key – A Candidate Key that is used by the database designer for unique
identification of each row in a table is known as Primary Key. A Primary Key can consist
of one or more attributes of a table.
E.g. of Primary Key - Database designer can use one of the Candidate Key as a Primary
Key. In this case we have “Code” and “Name, Address” as Candidate Key, we will
consider “Code” Key as a Primary Key as the other key is the combination of more than
one attribute.
(IV) Foreign Key – A foreign key is an attribute or combination of attribute in one base
table that points to the candidate key (generally it is the primary key) of another table.
The purpose of the foreign key is to ensure referential integrity of the data i.e. only values
that are supposed to appear in the database are permitted.
E.g. of Foreign Key – Let consider we have another table i.e. Department Table with
Attributes “Department_ID”, “Department_Name”, “Manager_ID”, ”Location_ID” with
Department_ID as an Primary Key. Now the Department_ID attribute of Employee Table
(dependent or child table) can be defined as the Foreign Key as it can reference to the
Department_ID attribute of the Departments table (the referenced or parent table), a
Foreign Key value must match an existing value in the parent table or be NULL.
(V) Composite Key – If we use multiple attributes to create a Primary Key then that
Primary Key is called Composite Key (also called a Compound Key or Concatenated
Key).
E.g. of Composite Key, if we have used “Name, Address” as a Primary Key then it will
be our Composite Key.
(VI) Alternate Key – Alternate Key can be any of the Candidate Keys except for the
Primary Key.
E.g. of Alternate Key is “Name, Address” as it is the only other Candidate Key which is
not a Primary Key.
(VII) Secondary Key – The attributes that are not even the Super Key but can be still
used for identification of records (not unique) are known as Secondary Key.
E.g. of Secondary Key can be Name, Address, Salary, Department_ID etc. as they can
identify the records but they might not be unique.
Candidate key is a Unique Key and it can be used to find out any purticular Tuple(row) in
a table..
a Primary key is also a Candidate Key...
For Example:-Create a table Name ‘Employees’ with 3 records and use ALTER, UPDATE,
DROP, DELETE, CREATE and INSERT command.
Solution:-
EID integer,
EName varchar(20),
department varchar(20),
Salary Integer
MS DOS