Monday, October 19, 2020

Operating Systems Theory and Design

 Section 1:

The main purpose of an Operating System is to allow application programs access to the systems hardware resources. This access is done through the Operating system by providing resource utilization and allocation, the Operating System is constantly waiting on an event in the form of an interrupt which can be sent from both hardware and software. When software triggers an interrupt it is done in the form of a system call.

Operating Systems can come in many variations and may or may not have a user interface depending on what the system is designed to accomplish. For example, you might have a vehicle that could have several different computer systems with each built to handle specific functions. One might just handle operations for the engine controlling the air and fuel intake and adjust the timing depending on certain variables that are constantly being monitored; in this case there most likely would not be any user interface for the operating system controlling the hardware for this system. But then you have your traditional PC that has more standard and well-known Operating Systems allowing the user access to much of the hardware available within the system such as file storage, CPU, and GPU controls such as overclocking and controlling the power limits, etc. All Operating Systems manage the hardware of that specific system which consists of the CPU, Memory (RAM, ROM, EEPROM), Storage as well as any other I/O that could vary significantly depending on the underlying system.




Section 2:

A process is a program that is currently running/executing, and within the process, there can be single or multiple threads within the process, programs might also have multiple processes associated with them.

The process state is defined by the current activity of a process, the different Process States are;

  • New: The process is being created
  • Running: Instructions are being executed
  • Waiting: The process is waiting for some event to occur
  • Ready: The process is waiting to be assigned to a processor
  • Terminated: The process has finished execution

 Processes are represented within the Operating System by the Process Control Block or PCB. The PCB contains a wide range of data for each process such as process id, process state, program counter, registers, memory limits, CPU scheduling, etc.

A traditional process utilizes a single thread allowing the ability to perform a single task, however, if a process has multiple threads it can then perform multiple tasks at the same time

The critical-section problem deals with different processes trying to access or use a specific resource at the same time. For example, if you have two different processes and they are both trying to access the same .txt file in order to write to it at the same time, the critical-section, in this case, would be the text trying to be written to the file. 

Peterson’s Solution preserves all three conditions :

  • Mutual Exclusion is assured as only one process can access the critical section at any time.
  • Progress is also assured, as a process outside the critical section does not block other processes from entering the critical section.
  • Bounded Waiting is preserved as every process gets a fair chance.

Section 3:

The main objective within memory management of any system to create the most efficient and productive use of the CPU, there are different methods used within memory management in an OS to help accomplish this task including swapping, paging, use of virtual memory, etc. Swapping for example takes the process currently stored within the main memory / RAM and will swap it out with a process currently stored in secondary storage / HDD in order to allow execution of the second process. Virtual memory in contrast will be used to allow programs that require more space than is physically allowed within the main memory by creating this virtual space within the secondary memory.

Within a computer system anytime a program is called and executed becoming a process running on the CPU an address will be bound to this process, for both the compile-time and load-time methods of address-binding an identical address is created for both the logical (virtual) and physical address. In contrast within the execution-time method of address-binding, a different logical and physical address is created. The process of mapping a logical / virtual address to a physical address if performed by the memory-management unit or MMU.


Section 4:

File systems management is responsible for managing all of the secondary storage within a computer system which includes all present physical disks. These can range from several different types of devices and physical interfaces such as SCSI, IDE, and SATA. These physical disks are each represented as physical partitions within the computer system and can also be broken up into multiple logical partitions allowing the operating system to view them as separate partitions as well. Within each of the partitions whether they be physical or logical there are file directories that contain all the files within that partition. Some of the operations that can be done on a directory can be seen below;

  • Search for a file
  • Create a new file
  • Delete a file
  • List a directory
  • Rename a file
  • Browse the file system


    Within file-system management, there are also different types of directories including;

Single-Level Directory – All of the files are contained within the same directory and each file must have a unique name.

Two-Level Directory – A directory is created for each user.

Tree-Structural Directories – The user is allowed to create their own sub-directories and organize them as they see fit, where the path is the route from the root down through all the sub-directories to specific files.

General Graph Directory – When links are added to a tree-structured directory it is destroyed and results in a general graph directory.

Acyclic-Graph Directories – This can be useful when the same files need to be accessed or shared by more than one user or process.


Section 5:

With Domain-based Protection the use of a domain which is a collection of access rights on objects within the Operating System between both Hardware objects and Software objects. Using an access matrix, you can see in the below example of how domain-based protection would allow access to individual objects and what particular access is allowed for each object within the different domains which can consist of users, processes, or procedures within the system.



Language-based Protection is a specification of protection within a programming language allowing a high-level description of policies for both the allocation and use of the resources, this implementation can provide software protection, when hardware supported checking, may otherwise be unavailable. Within Java for example this protection is handled within the Java Virtual Machine (JVM) where a class is assigned a protection domain when loaded by the JVM. This protection domain then handles what operation the class can and cannot perform.

Security in contrast to protection is used to specifically deal with external threats to a system by using things such as firewalls to help protect against outside systems and networks and security measures like biometrics or similar methods to secure against unwanted physical human access.






Final Concept Map -  Concept Map


References:


Silberschatz, A., Galvin, P. B., & Gagne, G. (2014). Operating system concepts essentials (2nd ed.). Retrieved from https://redshelf.com/


Geeks for Geeks (2019) Introduction of Process Synchronization. Retrieved from https://www.geeksforgeeks.org/introduction-of-process-synchronization/#:~:text=Peterson's%20Solution%20is%20a%20classical,to%20enter%20the%20critical%20sectionLinks to an external site..


Thursday, September 19, 2019

Algorithmic Design and Data Structure


Implementing Algorithms and Data Structure might seem a bit overwhelming at first however even just understanding the basic meaning it a good place to start. An algorithm can be defined as "a sequence of steps for accomplishing a task"(Lysecky, Vahid, Lysecky, and Givargis, 2016).

Taking this into consideration one of the best places to start would be having a full understanding of what the task is that you are trying to accomplish. By doing this you will then be able to decide what type of algorithm or data structure is needed.

For example, if you are just wanting to capture the names of 20 different people you can use something as simple as a list as the data structure. If you want to be able to find a specific person in that list, then you could use a Search algorithm to do this. And in implementing this search you would first have to apply a sort algorithm since a list must be sorted prior to being searched.

If you are needing to do something more complex that may need to store data within several levels you could implement a Tree type data structure. A good example could be something like automobiles. At the top level you just have cars, going down a level you could then provide Car Manufactures, going down another level makes of cars. Below is an example of this.

Tree_example.JPG

Most people automatically hear the word Algorithm and may shy away however there are many different functions that qualify and do not necessarily need to be over-complex. You may have a list of 100 different random numbers and need to get the median number, you can build a small method/function to perform this calculation, and that is an algorithm. However, most high-level programming languages have many built-in functions within a Class already. In Java many different math functions are already pre-loaded within the Math Class, making more complex problems much easier. 

This is also the case with many other algorithms such as sort, search, max, min, etc. And although building many of these functions/methods can be beneficial in certain circumstances there is no need to re-invent the wheel multiple times if the algorithm you are needed to perform is already built into a Class you can call. 

From my limited experience being able to understand and plan through what the actual problem is you are trying to solve or function you are trying to perform is key and can make the rest of the process much easier.

There is almost a numberless amount of algorithms and data structures someone might encounter and work with however many of them share many similarities and actually come from the same type of data structure. I am sure most of you have heard of at least 1 of the following; JSON, XML, HTML and although each of these might have their own differences they all share a similar data structure so they are not so different either.

The best advice I can give from my experience is just like anything else you learn in life whether it's riding a bike or learning a new spoken language or learning to program. Practice every day even if it is only for several minutes!!

Good luck to everyone on your journey!

Thursday, August 22, 2019

Java and OOP - Intro

Welcome, the first thing to do in getting started with Java is to make sure you have a Java Development Kit installed. 

The latest JDK can be found at the below URL, 

Next, you will want to download and install an IDE (Integrated Development Environment) to work in. I personally prefer IntelliJ however there are many different IDE's available to work with Java including Netbeans which is available here, https://netbeans.apache.org/download/

However, I would suggest trying IntelliJ and see how you like it. I have used this IDE for over a year now and program Python as well as recently Java and JavaScript with it and highly recommend it. Also when installing IntelliJ it installs everything you need including the JDK in order to get started.


Once you have the IDE installed there is a short tutorial in order to get you going on your first small program. https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html#get-started


Object-Oriented Programming

There are many concepts that bring OOP together as a whole. However, in its basic form OOP, consists of the following.

    - Object
    - Class
    - Package

An object is anything that can have characteristics attributed to it, so the object Employee might have the following attributed to it.

  - Name
  - Phone #
  - SSN
  - Address

A Class is a sort of blueprint for objects and facilitates manipulating objects and interacting with other Classes and Objects within them. For example, you might have a class where your main() method is and from there you might create multiple Employee objects from invoking the Employee Class.

A Package is a namespace that contains all related classes and objects allowing them to interact with each other while keeping them separated as well.


Coming from Python where for the most part all of my code is all in the same file and accessible through different functions/methods OOP can be pretty confusing at first. But for large complex programs, it makes complete sense. For in-depth explanations of OOP Concepts please refer to this URL, https://docs.oracle.com/javase/tutorial/java/concepts/inheritance.html
















Sunday, October 14, 2018

Tech Topic


    As defined in our course text, “Hardware is the term for the physical parts of a computer”. As the bare bones of everything within Information Technology everything in all categories and facets of IT comes back to these bare bones and the computer hardware that supports them all.

So how does this all relate to the concepts of computer science and the history of computers? All the roots of computer science and of course all major developments within computing technology directly relates to the hardware and components that drive them. Without leaps in hardware technology each and every aspect within IT would be stagnate.

Programming languages have evolved since the inception of computer hardware and the hardware can drive the developments within computer programming and software as more powerful and accessible hardware can open into even more possibilities that could not have been possible on older less powerful hardware. As well as hardware being able to be bought by so many different geographical locations and incomes that were not possible in earlier days of hardware. Today small computers call Raspberry Pi can be purchased for less than $50 and have capabilities to do very many different tasks including being able to run a Python development environment.

But also without efficient programming and understanding of hardware capabilities the power and capabilities would be lost, meaning that although hardware can help drive increased development of software the opposite can also be true, for example according to computerscience.org “Most device drivers are still developed using C Language”, so being able to program efficiently within certain languages you are also able to get all the capabilities from the hardware that in turn supports the other programs being written to use that hardware.

Even within the Database world hardware plays a huge role as storage capabilities have evolved over time there are very specialized hardware components that can be used specifically just for database functions and storage. These can include storage arrays in the form of SAN, NAS, hybrid arrays and all can have very specific functions on a network. Some use slower spinning HDD’s and allow for long-term reliable storage for organizations that might require 7+ years’ worth of storage but do not need to be accessed very often. Others require large amounts of storage that need to be accessed every couple of seconds and require a high level of redundancy so will use very high-speed spinning HDD’s some can run as fast or faster than 15000 rpm and using RAID arrays allowing multiple drive failures at a time. I had the great opportunity to be a storage engineer / technician for a couple of years for Dell, so I was able to see a wide variety of these installed across many different businesses and government locations during my time and it is truly fascinating technology and even more so now.

As with everything else up to this point network architecture, management and security are no exception and are directly driven by the hardware behind them and again as hardware evolves so does all networking components and the need for networking hardware advances is only becoming more needed than ever as all businesses have either already aligned with IT systems or are doing so now all information being used for everything is or will be floating in the open air and needs to be protected. Not only in the public but also at the consumer level. Even more so now in a time where everything is being developed within virtual ‘cloud’ environments network security should be at the forefront of it all.



Vahid, F., & Lysecky S. (2017). Computing technology for all. Retrieved from

https://learn.zybooks.com/zybook/ASHFORDINT100AcademicYear2018/chapter/2/section/1



Retrieved from https://www.computerscience.org/resources/computer-programming-languages/

Most device drivers are still developed using C Language.

Thursday, October 11, 2018

Network Security


    During the week 3 Assignment where we picked different websites and pinged them using the URL as the destination this command also reveals the IP address / addresses linked to the servers behind the DNS which in turn allows network attacks which are called Denial of Service attacks or DoS and DDoS attacks on those websites. So why are DDoS attacks so effective, "DDoS attacks achieve effectiveness by utilizing multiple compromised computer systems as sources of attack traffic. Exploited machines can include computers and other networked resources such as IoT devices." What is a DDoS Attack?  Retrieved from https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/





Phishing and Social Engineering



    I have chosen to speak more about both Phishing and Social Engineering as in both my current and past positions I have been in a place that requires yearly training on both of these subjects in order to educate its employees of the harms and safe guards against them. Phishing as described in the book "is an Internet scam that baits a user to share sensitive information like a password or credit card number." Social Engineering is when someone or a group of people can target individuals from within a company or organization in which they might want to gain outside access to or cause malicious harm to. This could include trying to gain physical access to a location where equipment might being housed. This could also be just getting enough information from someone in order to get more information about them or someone else within that company or organization. 



Examples and Potential Damage



For example getting to know someone who might work at a local bank and pretending to be interested in them or a product and getting their e-mail address they use for business, after gaining this information they might send an e-mail that looks like it is legitimate but actually is a phishing e-mail in order to gain the actual information they were wanting to get in the first place all without the person who was targeted even really understanding what was going on. This could include gaining access to user accounts which would have most likely all the personal information on those affected including SSN, bank account records, Addresses, phone numbers etc. 



Ways to Defend



In the time I have worked for both Government agencies and Financial institutions I have seen personal information within Databases which in some cases was fully available upon gaining access to the DB, going a step further and not only encrypting personal information that is being transmitted outside but also the information as it sits in the DB is a very good practice. Also educating employees on how you might be caught being social engineered without your knowing unless you understand the signs to look for and how to avoid being targeted in some cases the most simple things can stop those from happening, for example if you work somewhere that requires a badge and has restricted access, do not keep your badge in plain sight ever and remove it from your person as soon as you leave work, if you vehicle has a parking pass remove it when leaving the location, don’t post anywhere online where you actually work and be vague perhaps just mentioning the type of work you do. Having educated staff is extremely important as most times a data breach can be tied back to a human error of some kind.






Computers in the Workplace

Computers in the Financial Industry

    Since I have been working in the banking industry for the past 10 years and specifically in an IT capacity for that time this is the industry I have chosen. Pretty much everything that is done within the financial industry touches a computer somewhere and has been that way probably since before I was ever even born as there are a lot of applications and functions to do with transactions that were originally done on a mainframe before the PC was even an idea and some of those functions still run on mainframes today. From the second you swipe a credit card there are hundreds if not thousands of processes that are being ran in order to get the approvals for the transaction and many different people involved, issuing bank, processor, the POS system etc. It is pretty crazy to think about and I don't even have a full complex understanding of the entire process from end to end as there are a lot of things that I am not even involved in and areas that governed by outside agencies and third parties. In the financial industry it is especially important for all employees to be very computer literate as all the work being done is contained there and also to have that understanding to protect themselves as well as others from possible data leaks and breaches as the majority of the data being handled and processed is confidential. 

What's next?

    As far as evolution in computer hardware and technology I feel that most of what will shape the future over say the next 10 years or so is here now and just starting to be adopted by large companies now in the form of cloud computing and machine learning and artificial intelligence. Although it is funny to think that a lot of these technologies are not necessarily new but just being used in new ways. For example cloud computing, things like AWS, MS Azure and other 'cloud computing' offerings are not new technologies just new ways of using those technologies. Virtual Machines have been used for many many years however mostly within a closed environment and not offered by a company to be used as development and production environments for other companies which in a nutshell is basically what AWS and others offer. You can build your application and have it running live without ever having to boot up a server physically or deal with web hosting servers, patching OS's... etc. 

Traveling Through a Network

How ping and tracert work

    Using the ping and trace route commands the packets are sent from the requesting network source to the host network source through all the connected network equipment and lines including the local area network out to the wide area network and all the communication lines connecting all the routers in between the host website and the requester. I used the Nintendo of Japan website and a website in Russia that appeared to be similar to Yahoo or MSN for the ping and trace route activity, I found it interesting that even though the distance geographically was not completely different that the results were, the Nintendo of Japan website took 32ms and was over the span of 9 different hops where the Russian website was 148ms and over the span of 14 hops with 2 of them timing out. I do wonder if the Nintendo of Japan was perhaps faster and less hops because it may have been connected via satellite where the Russian website might have been connected through all mainland lines, really make me wonder.


Are they useful?


Ping can be helpful in not only quickly being able to see if whatever host you might be trying to connect to is even available but the amount of time it can take and possibly any sort of lag you may encounter depending on what you are trying to accomplish. It does however only really provide that limited information and diving deeper and using the trace route command you are able to see for example where the connection is having issues such as timing out and what the IP address is where it can connect to and how far the connection is able to get and or how many hops before encountering any of those issues. This could be useful as you might be able to get in touch with some support team and give them the information so they can troubleshoot from their end. A ping and or trace route might time out or return with an error if the host name / DNS is not resolving or if any of the routers or other networking equipment is having issues or is down. 

My Ping / Trace route Results

**********************************
**********************************
https://www.nintendo.co.jp/
ping www.nintendo.co.jp
tracert www.nintendo.co.jp
C:\Users\Adam>ping www.nintendo.co.jp
Pinging e5192.g.akamaiedge.net [184.25.181.244] with 32 bytes of data:
Reply from 184.25.181.244: bytes=32 time=29ms TTL=56
Reply from 184.25.181.244: bytes=32 time=29ms TTL=56
Reply from 184.25.181.244: bytes=32 time=28ms TTL=56
Reply from 184.25.181.244: bytes=32 time=28ms TTL=56
Ping statistics for 184.25.181.244:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 28ms, Maximum = 29ms, Average = 28ms
C:\Users\Adam>tracert www.nintendo.co.jp
Tracing route to e5192.g.akamaiedge.net [184.25.181.244]
over a maximum of 30 hops:
  1     2 ms     2 ms     4 ms  192.168.1.1
  2    11 ms    18 ms    13 ms  xxx.xxx.xxx.xxx
  3    26 ms    31 ms    32 ms  agg63.mtvroh2702h.midwest.rr.com [65.25.145.85]
  4    19 ms    23 ms    15 ms  agg43.clmcohib01r.midwest.rr.com [24.33.161.128]
  5    21 ms    21 ms    23 ms  be27.clevohek01r.midwest.rr.com [65.29.1.38]
  6    31 ms    31 ms    27 ms  bu-ether17.vinnva0510w-bcr00.tbone.rr.com [66.109.6.70]
  7    34 ms    32 ms    30 ms  bu-ether11.asbnva1611w-bcr00.tbone.rr.com [66.109.6.30]
  8    29 ms    29 ms    31 ms  0.ae2.pr1.dca10.tbone.rr.com [107.14.17.204]
  9    30 ms    30 ms    32 ms  a184-25-181-244.deploy.static.akamaitechnologies.com [184.25.181.244]
Trace complete.
**********************************
**********************************
https://www.yandex.ru/
ping www.yandex.ru
Pinging www.yandex.ru [77.88.55.88] with 32 bytes of data:
Reply from 77.88.55.88: bytes=32 time=145ms TTL=52
Reply from 77.88.55.88: bytes=32 time=139ms TTL=52
Reply from 77.88.55.88: bytes=32 time=142ms TTL=52
Reply from 77.88.55.88: bytes=32 time=143ms TTL=52
Ping statistics for 77.88.55.88:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 139ms, Maximum = 145ms, Average = 142ms
tracert www.yandex.ru
Tracing route to www.yandex.ru [77.88.55.88]
over a maximum of 30 hops:
  1     2 ms     1 ms     3 ms  192.168.1.1
  2    13 ms    11 ms    13 ms  xxx.xxx.xxx.xxx
  3    28 ms    33 ms    31 ms  agg63.mtvroh2702h.midwest.rr.com [65.25.145.85]
  4    19 ms    15 ms    15 ms  agg43.clmcohib01r.midwest.rr.com [24.33.161.128]
  5    23 ms    24 ms    21 ms  be27.clevohek01r.midwest.rr.com [65.29.1.38]
  6    30 ms    29 ms    32 ms  bu-ether17.vinnva0510w-bcr00.tbone.rr.com [66.109.6.70]
  7    26 ms    27 ms    28 ms  0.ae0.pr0.dca20.tbone.rr.com [107.14.19.65]
  8     *      570 ms   601 ms  ge-7-1-6.pr0.chi10.tbone.rr.com [66.109.9.74]
  9     *        *        *     Request timed out.
 10    29 ms    33 ms    30 ms  YANDEX-EURO.bear1.Washington111.Level3.net [4.14.97.242]
 11   144 ms   140 ms   142 ms  ams1-b1-xe-1-3-0.yndx.net [213.180.213.193]
 12   140 ms   138 ms   142 ms  jansson-et-4-1-0.yndx.net [213.180.213.95]
 13     *        *        *     Request timed out.
 14   144 ms   144 ms   148 ms  yandex.ru [77.88.55.88]
Trace complete.
**********************************
**********************************
ping www.google.com
Pinging www.google.com [172.217.4.68] with 32 bytes of data:
Reply from 172.217.4.68: bytes=32 time=33ms TTL=53
Reply from 172.217.4.68: bytes=32 time=35ms TTL=53
Reply from 172.217.4.68: bytes=32 time=34ms TTL=53
Reply from 172.217.4.68: bytes=32 time=35ms TTL=53
Ping statistics for 172.217.4.68:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 33ms, Maximum = 35ms, Average = 34ms
tracert www.google.com
Tracing route to www.google.com [172.217.6.4]
over a maximum of 30 hops:
  1     3 ms     2 ms     3 ms  192.168.1.1
  2    13 ms    12 ms    13 ms  xxx.xxx.xxx.xxx
  3    30 ms    29 ms    31 ms  agg63.mtvroh2702h.midwest.rr.com [65.25.145.85]
  4    20 ms    23 ms    21 ms  agg43.clmcohib01r.midwest.rr.com [24.33.161.128]
  5    27 ms    32 ms    29 ms  be27.clevohek01r.midwest.rr.com [65.29.1.38]
  6    30 ms    31 ms    39 ms  bu-ether17.vinnva0510w-bcr00.tbone.rr.com [66.109.6.70]
  7    28 ms    32 ms    29 ms  bu-ether11.asbnva1611w-bcr00.tbone.rr.com [66.109.6.30]
  8    27 ms    28 ms    33 ms  0.ae4.pr1.dca10.tbone.rr.com [66.109.1.113]
  9    28 ms    29 ms    32 ms  ix-ae-17-0.tcore2.aeq-ashburn.as6453.net [216.6.87.149]
 10    29 ms    29 ms    28 ms  72.14.198.28
 11    29 ms    28 ms    30 ms  108.170.246.49
 12    31 ms    32 ms    30 ms  216.239.50.97
 13    33 ms    33 ms    35 ms  209.85.253.248
 14    35 ms    35 ms    35 ms  216.239.40.188
 15    37 ms    37 ms    40 ms  108.170.243.174
 16    34 ms    37 ms    36 ms  108.170.238.137
 17    34 ms    35 ms    33 ms  ord38s01-in-f4.1e100.net [172.217.6.4]
Trace complete.

**********************************
**********************************