Code never lies, comments sometimes do [Ron Jeffries]

Visitors Map

Follow on Twitter

@ZammaCode
Powered by Blogger.

Friday, February 28, 2014

IPv4 Network Classes


IPv4 addresses are divided into three groups:

Unicast Addresses

It includes Class A, B and C. Firs octet most significant bit identifies the class of IP address.
  • Class A IP addresses first octet start with 1-126.The first octet has a format 0xxxxxxx,where 0 identifies that it is Class A. 
  • Class B IP addresses first octet start with 128-191.The first octet has format 10xxxxxx, where 10 identifies that it is class B.
  • Class C IP addresses first octet start with 192-223.The first octet has format 110xxxxx, where 110 identifies that it is class C.

Multicast Addresses

It includes Class D.
  • Class D IP addresses first octet start with 224-239.

Experimental Addresses

It includes Class E. These addresses are only used for experimental purposes and its first Octet start with
240-255.

Table lists the different facts about Class A, B and C networks.

  • Network Number/ID is the lowest number in the network
  • Total networks are the available number of networks in one class, it can be calculated by 2^network_bits. It must be noted that network bits are always one, two and three bit less; it is because the Class A reserve 1-bit, Class B reserve 2-bits and Class C reserve 3-bits for the identification of class.
  • The mask communicates the network and host parts of the IP address to the computer, therefore; every Class has its associated default subnet mask.
  • Broadcast Address of a Class is the numerically highest number in network. Routers forward a copy of packet with broadcast address as destination to all hosts in Classful network.
  • In between Network ID and Network Broadcast Address is the range of Usable IP Addresses. It can be calculated by 2^h-2. Two addresses (namely; network ID and broadcast address) are subtracted from the total available addresses as there addresses can't be used for hosts/nodes.

To find then network ID, Network Broadcast and Usable Address for an IP Address follow the following steps: 

  1. Determine class of the IP address by examining first octet.
  2. Divide the IP address into network and host part.
  3. To find network ID, change host part octets to 0.
  4. To find broadcast address, change network ID's host octets to 255.
  5. To find first usable address, add 1 to the fourth octet of the network ID.
  6. To find last useable address, subtract 1 from the fourth octet of the network broadcast address.
Example (223.223.0.1)
  1. Class C
  2. Network Part (223.223.0), Host Part (1)
  3. Network ID = 223.223.0.0
  4. Broadcast Address = 223.223.0.255
  5. First Usable Address = 223.223.0.1
  6. Last Usable Address = 223.223.0.254

Reserved Network IDs

  • Class A network 0.0.0.0 was reserved for broadcasting requirements.
  • Class A network 127.0.0.1 is reserved for loopback addresses, which is used for software testing.

Sunday, February 16, 2014

Design Stages of IPv4 Subnetting


The design process of subnetting may involve the following steps:
  1. Investigate the Requirements for Subnetting
  2. Design your subnets to meet your requirements
  3. Decide how to implement the subnets

1) Investigate the Requirements for Subnetting

In investigation stage you decide:
  • Which nodes or hosts should be grouped in the same subnet?
  • Next by studying network diagrams etc. decide the total number of subnets, keep in mind that VLANs also require separate subnets to operate.
  • Decide the number of IP addresses each subnet will require, this will also include IP addresses for the router interfaces and switch IP addresses which are to be used for telnet, ssh etc.
  • Decide to use a single subnet mask for all subnets or variable length subnet mask (VLSM) to avoid wastage of IP addresses.

2) Design your Subnets to Meet your Requirements

At design stage you will:
  • Select the Internet Addressing Architecture
  • Select the Subnet Mask
  • Make list of all subnets to use

Internet Addressing Architecture
Internet Addressing Architecture divides the IP addresses into to two address spaces.
Private IP Addresses: Packets addresses with private IP address cannot be routed or transmitted through the Internet, however; they can be used by enterprises within their local networks. Following is the list of private IP addresses:
Class A --- 10.0.0.0 (No. of networks 1)
Class B --- 172.16.0.0 through 172.3.1.0.0 (No. of networks 16)
Class C – 192.168.0.0 through 192.168.255.0 (No. of networks 256)
Public IP Addresses: The Internet design requires that any one connecting to the Internet has to use a Public IP address, public IP addresses can only be routed through Internet. The problem face the IPv4 public IP address space is that it exhausted in 2011, to solve the issue the Internet community come-up with solutions like:
  • 128-bit IPv6
  • Network Address Translation (NAT); which allows the mapping of hundreds of private IP addresses to a single or more than one public IP address

Select the Subnet Mask
Once you decided on the number of subnets, host per subnet required, type of subnet and choose the Internet addressing architecture, next step would be to select the mask. Subnet mask define the network, subnet and host part of the network.

Mask selected must have enough subnet bits to number all subnets and at the same time the host part bits must also be large enough to accommodate the number of hosts in each subnet.

It’s worth mentioning here:
  • That the difference between Classful and Classless Networks is that Classful network use the default mask define for the Class (e.g. Class A’s default mask is 255.0.0.0), while the Classless network use the variable length subnet mask.
  • Subnet mask can be represented in decimal (255.0.0.0), binary (11111111.00000000.00000000.00000000), or prefix (/8)

Make List of All Subnets to Use
Find the subnet ID, subnet broadcast for each subnet, and IP addresses to use.
Subnet ID is the numerically the smallest number in subnet and it can’t be used as IP address for host.
Subnet Broadcast address is the numerically highest number in subnet and it is used for directed broadcast in the subnet.
IP addresses are the addresses between the subnet ID and subnet broadcast address, it can be used as host’s IP address.

3) Decide How to Implement the Subnets

Base on your network diagram identify the location for subnet, pick one from the list. Separate the static IP addresses and dynamic IP addresses assigned through DHCP.



Thursday, January 2, 2014

Enhancement of Standard Data Sources




§  Adding additional fields to a standard DataSource or changing its structure is termed as Enhancement
§  For example, if an SAP provides a standard DataSource with 10 fields and my requirement is to add 2 more fields to this DataSource which is not provided by SAP in this DataSource, but these 2 fields must be available at base table level
§  The procedure for both LO and Non-LO DataSources are the same, here we will enhance the LO DataSource as an example

Enhancement of Standard DataSource by Adding Extra Field from Communication Pool

1)      Login to ECC System
                     i.            Before adding field to DataSource, if you have data in your setup table you may get an error like setup table->Long text, go to LBWG enter 02 as Application here 02 is for Purchasing, click Execute, then click Yes
                   ii.            Go to LBWE (LO Cockpit), select DataSource 2LIS_02_SCL, click on Maintenance icon in Structure column, say Continue
                  iii.            In the selection Criteria pop up fields on the left are the fields available in our DataSource, while fields on the right are available in communication pool provided by SAP (The fields in communication pool has attached code to extract data), click the Filter combo to see the base tables, select MCEKKO MEMORY from the right and transfer it to the right section, click Continue, next click Yes
                 iv.            Now you will see that DataSource is turned into Inactive status in Update column, click DataSource name in DataSource column, click Continue in pop ups
                   v.            The fields you added will be in hidden status just uncheck them in Hide Field column, and click Save
                 vi.            Click Inactive in Update column to activate it
2)      Next you can follow the steps from “Loading Data from ECC System” to extract and load data

Enhancement of Standard DataSource by Adding Extra Field not Available in Communication Pool

1)      Login to BI System
As we already know tables related to purchasing are EKKO, EKPO etc.

                     i.            Go to SE11 to find your required field in table EKKO, copy the technical name (EBSTYP) from the Data element column
                   ii.            Go to RSA2, enter DataSource name 2LIS_02_ITM, click Display
                  iii.            On Extraction tab, double click the Extractor which will bring you the ABAP code written by SAP to extract data to this DataSource, we are not allowed to change this code, we will use the Extract Structure for this purpose, so double click the Extract Structure, in Extract Structure we will add the Append structure, from application toolbar click the Append Structure… button
                 iv.            Enter Append Name (usually its same as that of extract structure with z as starting letter), short description
                   v.            Paste ZEBSTYP in component column and EBSTYP in Component type column on Components tab
                 vi.            Activate it, now the field EBSTYP will appear in the Components tab of  Extract Structure window, this newly added field doesn’t have any logic to extract data, if we run the extract checker (RSA3) all fields will have data but this field will don’t have any data

To provide logic to our field for data extraction SAP provides 4 Exit functions which execute after the standard code of extractor is executed by DataSource, these are:
§  EXIT_SAPLRSAP_001              (Used for transactional datasource)
§  EXIT_SAPLRSAP_002              (Used for attribute datasource)
§  EXIT_SAPLRSAP_003              (Used for text datasource)
§  EXIT_SAPLRSAP_004              (Used for hierarchy datasource)

                vii.            Go to SE37, enter the EXIT_SAPLRSAP_001, click Display, double click on INCLUDE in code to open include file, scroll down to case i_datasource, click Insert from the application toolbar and type your code, here you will need a help of the ABAPer
This code will be given you by ABAPer
when ‘2lis_02_itm’.
       
        Types: begin of It_EKKO,
                                EBELN type EBELN,
                                ERNAM type ERNAM,
                        END OF it_EKKO.
        DATA: IT_EKKO TYPE STANDARD TABLE OF IT_EKKO,
                        WA_EKKO TYPE IT_EKKO.
        FIELD-SYMBOLS: <FS> TYPE MC02M_0HDR.
       
DATA: IT_DATA TYPE STANDARD TABLE OF MC02M_0HDR.
            IT_EKKO[] = C_T_DATA[].

        SELECT EBELN ERNAM FROM EKKO INTO TABLE IT_EKKO
        FOR ALL ENTRIES in IT_DATA
        WHERE EBELN = IT_DAT-EBELN.
IF SY-SUBRC = 0.
        LOOP AT C_T_DATA assigning <FS>.
        READ TABLE IT_EKKO INTO WA_EKKO WITH KEY ERNAM = <FS>-EBELN.
        IF SY-SUBRC = 0.
        <FS>-ZERNAM = WA_EKKO-ERNAM.
ENDIF.
ENDLOOP.
ENDIF.
              viii.            Activate it.
2)      Next you can follow the steps from “Loading Data from ECC System” to extract and load data