SlideShare a Scribd company logo
2
Most read
4
Most read
9
Most read
INPUT AND OUTPUT IN LINUX
OVERVIEW Linux follows the philosophy that every thing is a file. For ex. A keyboard, Monitor, Mouse, Printer.  The I/O system in Linux is like that in any Unix system. Here all device drivers appear as normal files. A user can access a device in the same way as he open any other file. The administrator can set access permission for each device.
CATEGORIES   Linux splits all devices into three classes :- Block Devices Character Devices Network Devices
BLOCK DEVICES It includes all devices such as Hard Disks, Floppy Disks, CD-ROMs and Flash Memory. These devices can be accessed randomly. They read only blocks of data.
CHARACTER DEVICES It include devices such as mice and keyboards. These devices are access only serially or sequentially. They read the data character by character.
NETWORK DEVICES These are dealt differently from Block and Character Devices. Users cannot directly transfer data to Network Devices; instead, they must communicate indirectly by opening a connection to the kernel’s networking sub-system.
DEVICE-DRIVER BLOCK STRUCTURE File system Block device File I/O  Scheduler Block Device  Driver SCSI manager SCSI Device Driver Character device File Character Device  Driver TTY Driver  Line Discipline Network Socket Network Device  Driver Protocol Driver
Block devices provide the main interface to all disk devices in a system, or block devices allow random access and fixed sized blocks of data, including hard disk, floppy disk, CD ROMs etc. in the context of block devices, block represents the unit with which the kernel perform I/O. when a block read in to memory, it stored in a buffer. The work of request manager in block devices. BLOCK DEVICES
Block devices (contd….) A separate list of requests is kept for each block device. These request have been scheduled according to a unidirectional elevator algorithm. The request are maintain in sorted order of increasing starting sector number. When a request is accept for processing by a block device driver, it’s not removed form the list .It is removed after only the input output is complete.
Block device (contd….) In the block device there are two problems that may occur :- STARVATION DEADLINE
Block device (contd…) The deadline for read requests is  0.5 sec. & for writing request is 5 sec. block device also maintains three  queue  Sorted queue Read queue Write queue These queues are ordered  according to deadline.
All Character devices deal with data one character at a time and process them seqentially. Eg. The keyboard  strokes,mouse clicks, etc. Any character-device drivers registered to the Linux kernel must also register a set of functions that implement the file I\O operations that the driver can handle. CHARACTER DEVICES
The kernel performs almost no preprocessing of a file read or write request to the device in question and lets the device deal with request. Printers  are character devices and after the kernel sends data to the printer,the responsibility for that data passes to the printer,the kernel cannot back up and  reexamine the data.
The exception to this rule is the special subset of character device drivers that implement terminal devices. The kernel maintains a standard interface to these drivers by means of a set of  tty_struct  structures. Each of these structures provide buffering and flow control on the data stream from the terminal device and feeds those data to a line discipline.
A line discipline is an interpreter for the information from the terminal device. The most common line discipline is the  tty discipline. tty discipline  decides which process’s data should be attached or detached from the terminal device.
Users can’t directly transfer data to network devices. They communicate indirectly by opening a connection to the kernel’s networking subsystem. Networking in LINUX kernel is implemented by three layers of software:- 1.  The socket interface 2. Protocol drivers 3. Network device drivers. NETWORK STRUCTURE
1.The socket interface : User applications perform all networking  requests through the socket interface. It  looks like BSD socket layer, so  that the program designed for BSD socket can easily run on LINUX without any source code changes. BSD socket is sufficient to represent network addresses for networking protocols.
2.Protocol drivers: It is the second layer of software. When data arrives to this layer ,it is expected to have been tagged with an identifier specifying which network protocol they contain. Functions of protocol layer: 1.Rewrite packets, 2.Create new packets, 3.Split or reassembling packets into fragments, 4.Discard incoming data.
3.Network–device drivers: Communication between the layers of networking stack is performed by passing single  skbuff  structures An  skbuff  is a set of   pointers into a single   continuous area of memory, representing a buffer inside which network packets can be constructed. The networking code either add or trim data from the end of packet.
The most important set of protocol used in LINUX is TCP\IP suite. IP protocol implements routing between different hosts, anywhere on the network. UDP protocol carries arbitrary individual datagrams between hosts TCP protocol implements reliable connection between hosts . ICMP protocol is used to carry various errors & status messages between hosts.
Incoming IP packets are delivered to the IP driver. This layer performs routing. After deciding the destination of a packet is forwarded to appropriate internal protocol driver to delivered locally or injects it back into a selected network –device driver queue to be forwarded to another host.
The routing can be done by two  tables: 1.FIB(forwarding information base) 2.Cache of recent routing decisions. 1. FIB is a set of hash tables indexed by destination address. 2. It caches routes only by specific destination. An entry in route cache expires after a fixed period with no hits.
IP software passes its packets to a separate section code for firewall management. It manages separate firewall chains 1.For forwarded packets 2.For packets being input to host 3.For data generated at the host. IP driver performs disassembly and reassembly of large packets.
Large outgoing packets are split up into smaller fragments At the receiving host these fragments are reassembled . Incoming fragments are matched against each known ipq; If a match is found fragment is added to it otherwise , new ipq is created  Once the final fragment has arrived new skbuff is created ,to hold anew packet. This is passed back to IP driver.

More Related Content

What's hot (20)

PPTX
System calls
Bernard Senam
 
PDF
Introduction to Operating Systems
Mukesh Chinta
 
PPT
Distributed file systems dfs
Pragati Startup Presentation Designer firm
 
PPTX
Storage management in operating system
DeepikaT13
 
PPTX
Dhcp ppt
Hema Dhariwal
 
PPTX
Dns presentation
Anurag Pandey
 
PPT
Memory management
Vishal Singh
 
PPTX
Process scheduling
Riya Choudhary
 
PPTX
File Management in Operating System
Janki Shah
 
PPT
Chapter03 Creating And Managing User Accounts
Raja Waseem Akhtar
 
PPT
Memory Management in OS
vampugani
 
PPTX
Virtualization
Srisailam Reddy Kanapuram
 
PPT
Chapter 4 data link layer
Naiyan Noor
 
PPTX
Distributed dbms architectures
Pooja Dixit
 
PPT
distributed shared memory
Ashish Kumar
 
PPT
Chapter 11 - File System Implementation
Wayne Jones Jnr
 
DOCX
VIRTUALIZATION STRUCTURES TOOLS.docx
kumari36
 
PPTX
Concurrency Control in Database Management System
Janki Shah
 
PPTX
2. Distributed Systems Hardware & Software concepts
Prajakta Rane
 
PPT
Domain name system
Siddique Ibrahim
 
System calls
Bernard Senam
 
Introduction to Operating Systems
Mukesh Chinta
 
Distributed file systems dfs
Pragati Startup Presentation Designer firm
 
Storage management in operating system
DeepikaT13
 
Dhcp ppt
Hema Dhariwal
 
Dns presentation
Anurag Pandey
 
Memory management
Vishal Singh
 
Process scheduling
Riya Choudhary
 
File Management in Operating System
Janki Shah
 
Chapter03 Creating And Managing User Accounts
Raja Waseem Akhtar
 
Memory Management in OS
vampugani
 
Chapter 4 data link layer
Naiyan Noor
 
Distributed dbms architectures
Pooja Dixit
 
distributed shared memory
Ashish Kumar
 
Chapter 11 - File System Implementation
Wayne Jones Jnr
 
VIRTUALIZATION STRUCTURES TOOLS.docx
kumari36
 
Concurrency Control in Database Management System
Janki Shah
 
2. Distributed Systems Hardware & Software concepts
Prajakta Rane
 
Domain name system
Siddique Ibrahim
 

Viewers also liked (20)

ODP
Memory management in Linux
Raghu Udiyar
 
PPT
Linux io
Sagar Janagonda
 
PDF
Ui disk & terminal drivers
Sarang Ananda Rao
 
PPT
Chap2 hdd1
Faiq Ali Sayed
 
ODP
Unix Memory Management - Operating Systems
Drishti Bhalla
 
PDF
Inter process communication using Linux System Calls
jyoti9vssut
 
PPT
Linux/DB Tuning (DevSumi2010, Japanese)
Yoshinori Matsunobu
 
PPT
Disk scheduling
Hi-Techpoint
 
PPTX
Linux memory-management-kamal
Kamal Maiti
 
PPTX
New inventions in robotics
Tasmiya Banu R
 
PPT
Input output systems ppt - cs2411
Geerthik Varun
 
PPT
Chapter 13 - I/O Systems
Wayne Jones Jnr
 
PPT
Memory management in linux
Dr. C.V. Suresh Babu
 
PPT
Linux Memory
Vitaly Nahshunov
 
PDF
The linux networking architecture
hugo lu
 
PPTX
Gestion de memoria en windows
Osvaldo Magaña Cantú
 
PPT
Disk scheduling
J.T.A.JONES
 
ODP
Gestion de memoria en Linux
ChriztOpher Medina
 
PPT
Unix memory management
Tech_MX
 
Memory management in Linux
Raghu Udiyar
 
Linux io
Sagar Janagonda
 
Ui disk & terminal drivers
Sarang Ananda Rao
 
Chap2 hdd1
Faiq Ali Sayed
 
Unix Memory Management - Operating Systems
Drishti Bhalla
 
Inter process communication using Linux System Calls
jyoti9vssut
 
Linux/DB Tuning (DevSumi2010, Japanese)
Yoshinori Matsunobu
 
Disk scheduling
Hi-Techpoint
 
Linux memory-management-kamal
Kamal Maiti
 
New inventions in robotics
Tasmiya Banu R
 
Input output systems ppt - cs2411
Geerthik Varun
 
Chapter 13 - I/O Systems
Wayne Jones Jnr
 
Memory management in linux
Dr. C.V. Suresh Babu
 
Linux Memory
Vitaly Nahshunov
 
The linux networking architecture
hugo lu
 
Gestion de memoria en windows
Osvaldo Magaña Cantú
 
Disk scheduling
J.T.A.JONES
 
Gestion de memoria en Linux
ChriztOpher Medina
 
Unix memory management
Tech_MX
 
Ad

Similar to Input output in linux (20)

PPT
Linux Device Driver,LDD,
Rahul Batra
 
PPT
linux device driver
Rahul Batra
 
PDF
Driver Programming Report
Shivek Khurana
 
PPTX
Device Drivers
Kushal Modi
 
PPT
Embedded system - embedded system programming
Vibrant Technologies & Computers
 
PPTX
Ioppt
arun sharma
 
PPTX
Linux@assignment ppt
Rama .
 
DOCX
linux file sysytem& input and output
MythiliA5
 
PDF
Introduction to char device driver
Vandana Salve
 
PPT
Ch13 OS
C.U
 
PPT
OSCh13
Joe Christensen
 
PPT
lecture_1_introduction.ppt
RandyGaray
 
PPT
lecture_1_introduction_linux_1234567.ppt
ubalearchana6
 
PPTX
Linux device drivers
Abhishek Sagar
 
PPT
chapter 4 Device Management systemss.ppt
danielarega25
 
PPTX
Output subsystem interfacing
manojmanoj218596
 
PPT
Ch13
tech2click
 
PPT
Chapter 05
Google
 
PDF
Embedded linux network device driver development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Linux Device Driver,LDD,
Rahul Batra
 
linux device driver
Rahul Batra
 
Driver Programming Report
Shivek Khurana
 
Device Drivers
Kushal Modi
 
Embedded system - embedded system programming
Vibrant Technologies & Computers
 
Linux@assignment ppt
Rama .
 
linux file sysytem& input and output
MythiliA5
 
Introduction to char device driver
Vandana Salve
 
Ch13 OS
C.U
 
lecture_1_introduction.ppt
RandyGaray
 
lecture_1_introduction_linux_1234567.ppt
ubalearchana6
 
Linux device drivers
Abhishek Sagar
 
chapter 4 Device Management systemss.ppt
danielarega25
 
Output subsystem interfacing
manojmanoj218596
 
Chapter 05
Google
 
Embedded linux network device driver development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Ad

More from Dr. C.V. Suresh Babu (20)

PPTX
Data analytics with R
Dr. C.V. Suresh Babu
 
PPTX
Association rules
Dr. C.V. Suresh Babu
 
PPTX
Clustering
Dr. C.V. Suresh Babu
 
PPTX
Classification
Dr. C.V. Suresh Babu
 
PPTX
Blue property assumptions.
Dr. C.V. Suresh Babu
 
PPTX
Introduction to regression
Dr. C.V. Suresh Babu
 
PPTX
Expert systems
Dr. C.V. Suresh Babu
 
PPTX
Dempster shafer theory
Dr. C.V. Suresh Babu
 
PPTX
Bayes network
Dr. C.V. Suresh Babu
 
PPTX
Bayes' theorem
Dr. C.V. Suresh Babu
 
PPTX
Knowledge based agents
Dr. C.V. Suresh Babu
 
PPTX
Rule based system
Dr. C.V. Suresh Babu
 
PPTX
Formal Logic in AI
Dr. C.V. Suresh Babu
 
PPTX
Production based system
Dr. C.V. Suresh Babu
 
PPTX
Game playing in AI
Dr. C.V. Suresh Babu
 
PPTX
Diagnosis test of diabetics and hypertension by AI
Dr. C.V. Suresh Babu
 
PPTX
A study on “impact of artificial intelligence in covid19 diagnosis”
Dr. C.V. Suresh Babu
 
PDF
A study on “impact of artificial intelligence in covid19 diagnosis”
Dr. C.V. Suresh Babu
 
Data analytics with R
Dr. C.V. Suresh Babu
 
Association rules
Dr. C.V. Suresh Babu
 
Classification
Dr. C.V. Suresh Babu
 
Blue property assumptions.
Dr. C.V. Suresh Babu
 
Introduction to regression
Dr. C.V. Suresh Babu
 
Expert systems
Dr. C.V. Suresh Babu
 
Dempster shafer theory
Dr. C.V. Suresh Babu
 
Bayes network
Dr. C.V. Suresh Babu
 
Bayes' theorem
Dr. C.V. Suresh Babu
 
Knowledge based agents
Dr. C.V. Suresh Babu
 
Rule based system
Dr. C.V. Suresh Babu
 
Formal Logic in AI
Dr. C.V. Suresh Babu
 
Production based system
Dr. C.V. Suresh Babu
 
Game playing in AI
Dr. C.V. Suresh Babu
 
Diagnosis test of diabetics and hypertension by AI
Dr. C.V. Suresh Babu
 
A study on “impact of artificial intelligence in covid19 diagnosis”
Dr. C.V. Suresh Babu
 
A study on “impact of artificial intelligence in covid19 diagnosis”
Dr. C.V. Suresh Babu
 

Recently uploaded (20)

PPTX
Types of post tensioning methods (2).pptx
RizwanAlavi
 
PDF
Graphic Designing Article All about Graphic Designing
Techera
 
PDF
BeeNexus Stall Design, Fabrication, and Branding in India
Beenexus
 
PDF
Florida Gulf Coast University (FGCU) Diploma
bogusdiploma
 
PDF
Sirisha .A Portfolio.
SirishaSiri487733
 
PDF
Balance Your Home with These Vastu Tips!
https://homzinterio.in/
 
PPTX
sCREW cONVEYOR AUGER DAF SLUDGE SYSTEM TO
viksurs
 
PPTX
condylar pptx.in relation to dental seurgery
abishekgowtham586
 
PDF
IPC_Reference_manual_Vol_1_Final (1).pdf
AbrahamFekede1
 
DOCX
Non_Communicable_Diseases_Risk_Assessment,_Prevention,_Control,.docx
DrFatemaTuzzannat
 
PPTX
英国硕士毕业证伦敦城市大学学位证书City毕业完成信办理
Taqyea
 
PDF
IDES-502_Project-1-Home_Presentation-Boards_Codamon.pdf
codamona
 
PPT
Origin of the solar system acording .ppt
ReignLachica
 
PPTX
(2) Cell Wall Inhibitors_Cephalosporins others.pptx
mkurdi133
 
PPTX
619813902-Fun-friday-Identify-Bollywood-movie-from-dialogues-deliver-the-dial...
in4withme
 
PDF
Design Social Change Creating Social Change
Eduardo Corrêa
 
PPTX
4. PMES PORTFOLIO_BROWN DESIGN_T1-T3_A4.pptx
GynnelNicanor1
 
PDF
Digital Marketing Expert Training Program
marketing226932
 
PDF
CRAC- Adobe Photoshop CC 2016 (32 64Bit) Crack
utfefguu
 
PPTX
SAMPLE FILE OF-PPT-FINAL-ORAL-DEFENSE.pptx
Yvez2
 
Types of post tensioning methods (2).pptx
RizwanAlavi
 
Graphic Designing Article All about Graphic Designing
Techera
 
BeeNexus Stall Design, Fabrication, and Branding in India
Beenexus
 
Florida Gulf Coast University (FGCU) Diploma
bogusdiploma
 
Sirisha .A Portfolio.
SirishaSiri487733
 
Balance Your Home with These Vastu Tips!
https://homzinterio.in/
 
sCREW cONVEYOR AUGER DAF SLUDGE SYSTEM TO
viksurs
 
condylar pptx.in relation to dental seurgery
abishekgowtham586
 
IPC_Reference_manual_Vol_1_Final (1).pdf
AbrahamFekede1
 
Non_Communicable_Diseases_Risk_Assessment,_Prevention,_Control,.docx
DrFatemaTuzzannat
 
英国硕士毕业证伦敦城市大学学位证书City毕业完成信办理
Taqyea
 
IDES-502_Project-1-Home_Presentation-Boards_Codamon.pdf
codamona
 
Origin of the solar system acording .ppt
ReignLachica
 
(2) Cell Wall Inhibitors_Cephalosporins others.pptx
mkurdi133
 
619813902-Fun-friday-Identify-Bollywood-movie-from-dialogues-deliver-the-dial...
in4withme
 
Design Social Change Creating Social Change
Eduardo Corrêa
 
4. PMES PORTFOLIO_BROWN DESIGN_T1-T3_A4.pptx
GynnelNicanor1
 
Digital Marketing Expert Training Program
marketing226932
 
CRAC- Adobe Photoshop CC 2016 (32 64Bit) Crack
utfefguu
 
SAMPLE FILE OF-PPT-FINAL-ORAL-DEFENSE.pptx
Yvez2
 

Input output in linux

  • 1. INPUT AND OUTPUT IN LINUX
  • 2. OVERVIEW Linux follows the philosophy that every thing is a file. For ex. A keyboard, Monitor, Mouse, Printer. The I/O system in Linux is like that in any Unix system. Here all device drivers appear as normal files. A user can access a device in the same way as he open any other file. The administrator can set access permission for each device.
  • 3. CATEGORIES Linux splits all devices into three classes :- Block Devices Character Devices Network Devices
  • 4. BLOCK DEVICES It includes all devices such as Hard Disks, Floppy Disks, CD-ROMs and Flash Memory. These devices can be accessed randomly. They read only blocks of data.
  • 5. CHARACTER DEVICES It include devices such as mice and keyboards. These devices are access only serially or sequentially. They read the data character by character.
  • 6. NETWORK DEVICES These are dealt differently from Block and Character Devices. Users cannot directly transfer data to Network Devices; instead, they must communicate indirectly by opening a connection to the kernel’s networking sub-system.
  • 7. DEVICE-DRIVER BLOCK STRUCTURE File system Block device File I/O Scheduler Block Device Driver SCSI manager SCSI Device Driver Character device File Character Device Driver TTY Driver Line Discipline Network Socket Network Device Driver Protocol Driver
  • 8. Block devices provide the main interface to all disk devices in a system, or block devices allow random access and fixed sized blocks of data, including hard disk, floppy disk, CD ROMs etc. in the context of block devices, block represents the unit with which the kernel perform I/O. when a block read in to memory, it stored in a buffer. The work of request manager in block devices. BLOCK DEVICES
  • 9. Block devices (contd….) A separate list of requests is kept for each block device. These request have been scheduled according to a unidirectional elevator algorithm. The request are maintain in sorted order of increasing starting sector number. When a request is accept for processing by a block device driver, it’s not removed form the list .It is removed after only the input output is complete.
  • 10. Block device (contd….) In the block device there are two problems that may occur :- STARVATION DEADLINE
  • 11. Block device (contd…) The deadline for read requests is 0.5 sec. & for writing request is 5 sec. block device also maintains three queue Sorted queue Read queue Write queue These queues are ordered according to deadline.
  • 12. All Character devices deal with data one character at a time and process them seqentially. Eg. The keyboard strokes,mouse clicks, etc. Any character-device drivers registered to the Linux kernel must also register a set of functions that implement the file I\O operations that the driver can handle. CHARACTER DEVICES
  • 13. The kernel performs almost no preprocessing of a file read or write request to the device in question and lets the device deal with request. Printers are character devices and after the kernel sends data to the printer,the responsibility for that data passes to the printer,the kernel cannot back up and reexamine the data.
  • 14. The exception to this rule is the special subset of character device drivers that implement terminal devices. The kernel maintains a standard interface to these drivers by means of a set of tty_struct structures. Each of these structures provide buffering and flow control on the data stream from the terminal device and feeds those data to a line discipline.
  • 15. A line discipline is an interpreter for the information from the terminal device. The most common line discipline is the tty discipline. tty discipline decides which process’s data should be attached or detached from the terminal device.
  • 16. Users can’t directly transfer data to network devices. They communicate indirectly by opening a connection to the kernel’s networking subsystem. Networking in LINUX kernel is implemented by three layers of software:- 1. The socket interface 2. Protocol drivers 3. Network device drivers. NETWORK STRUCTURE
  • 17. 1.The socket interface : User applications perform all networking requests through the socket interface. It looks like BSD socket layer, so that the program designed for BSD socket can easily run on LINUX without any source code changes. BSD socket is sufficient to represent network addresses for networking protocols.
  • 18. 2.Protocol drivers: It is the second layer of software. When data arrives to this layer ,it is expected to have been tagged with an identifier specifying which network protocol they contain. Functions of protocol layer: 1.Rewrite packets, 2.Create new packets, 3.Split or reassembling packets into fragments, 4.Discard incoming data.
  • 19. 3.Network–device drivers: Communication between the layers of networking stack is performed by passing single skbuff structures An skbuff is a set of pointers into a single continuous area of memory, representing a buffer inside which network packets can be constructed. The networking code either add or trim data from the end of packet.
  • 20. The most important set of protocol used in LINUX is TCP\IP suite. IP protocol implements routing between different hosts, anywhere on the network. UDP protocol carries arbitrary individual datagrams between hosts TCP protocol implements reliable connection between hosts . ICMP protocol is used to carry various errors & status messages between hosts.
  • 21. Incoming IP packets are delivered to the IP driver. This layer performs routing. After deciding the destination of a packet is forwarded to appropriate internal protocol driver to delivered locally or injects it back into a selected network –device driver queue to be forwarded to another host.
  • 22. The routing can be done by two tables: 1.FIB(forwarding information base) 2.Cache of recent routing decisions. 1. FIB is a set of hash tables indexed by destination address. 2. It caches routes only by specific destination. An entry in route cache expires after a fixed period with no hits.
  • 23. IP software passes its packets to a separate section code for firewall management. It manages separate firewall chains 1.For forwarded packets 2.For packets being input to host 3.For data generated at the host. IP driver performs disassembly and reassembly of large packets.
  • 24. Large outgoing packets are split up into smaller fragments At the receiving host these fragments are reassembled . Incoming fragments are matched against each known ipq; If a match is found fragment is added to it otherwise , new ipq is created Once the final fragment has arrived new skbuff is created ,to hold anew packet. This is passed back to IP driver.